(function($){
'use strict';
if(typeof wpcf7==='undefined'||wpcf7===null){
return;
}
wpcf7=$.extend({
cached: 0,
inputs: []
}, wpcf7);
$(function(){
wpcf7.supportHtml5=(function(){
var features={};
var input=document.createElement('input');
features.placeholder='placeholder' in input;
var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ];
$.each(inputTypes, function(index, value){
input.setAttribute('type', value);
features[ value ]=input.type!=='text';
});
return features;
})();
$('div.wpcf7 > form').each(function(){
var $form=$(this);
wpcf7.initForm($form);
if(wpcf7.cached){
wpcf7.refill($form);
}});
});
wpcf7.getId=function(form){
return parseInt($('input[name="_wpcf7"]', form).val(), 10);
};
wpcf7.initForm=function(form){
var $form=$(form);
$form.submit(function(event){
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder].placeheld', $form).each(function(i, n){
$(n).val('').removeClass('placeheld');
});
}
if(typeof window.FormData==='function'){
wpcf7.submit($form);
event.preventDefault();
}});
$('.wpcf7-submit', $form).after('');
wpcf7.toggleSubmit($form);
$form.on('click', '.wpcf7-acceptance', function(){
wpcf7.toggleSubmit($form);
});
$('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){
var name=$(this).attr('name');
$form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
});
$('.wpcf7-list-item.has-free-text', $form).each(function(){
var $freetext=$(':input.wpcf7-free-text', this);
var $wrap=$(this).closest('.wpcf7-form-control');
if($(':checkbox, :radio', this).is(':checked')){
$freetext.prop('disabled', false);
}else{
$freetext.prop('disabled', true);
}
$wrap.on('change', ':checkbox, :radio', function(){
var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio');
if($cb.is(':checked')){
$freetext.prop('disabled', false).focus();
}else{
$freetext.prop('disabled', true);
}});
});
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder]', $form).each(function(){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
$(this).focus(function(){
if($(this).hasClass('placeheld')){
$(this).val('').removeClass('placeheld');
}});
$(this).blur(function(){
if(''===$(this).val()){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
}});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){
$form.find('input.wpcf7-date[type="date"]').each(function(){
$(this).datepicker({
dateFormat: 'yy-mm-dd',
minDate: new Date($(this).attr('min')),
maxDate: new Date($(this).attr('max'))
});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){
$form.find('input.wpcf7-number[type="number"]').each(function(){
$(this).spinner({
min: $(this).attr('min'),
max: $(this).attr('max'),
step: $(this).attr('step')
});
});
}
$('.wpcf7-character-count', $form).each(function(){
var $count=$(this);
var name=$count.attr('data-target-name');
var down=$count.hasClass('down');
var starting=parseInt($count.attr('data-starting-value'), 10);
var maximum=parseInt($count.attr('data-maximum-value'), 10);
var minimum=parseInt($count.attr('data-minimum-value'), 10);
var updateCount=function(target){
var $target=$(target);
var length=$target.val().length;
var count=down ? starting - length:length;
$count.attr('data-current-value', count);
$count.text(count);
if(maximum&&maximum < length){
$count.addClass('too-long');
}else{
$count.removeClass('too-long');
}
if(minimum&&length < minimum){
$count.addClass('too-short');
}else{
$count.removeClass('too-short');
}};
$(':input[name="' + name + '"]', $form).each(function(){
updateCount(this);
$(this).keyup(function(){
updateCount(this);
});
});
});
$form.on('change', '.wpcf7-validates-as-url', function(){
var val=$.trim($(this).val());
if(val
&& ! val.match(/^[a-z][a-z0-9.+-]*:/i)
&& -1!==val.indexOf('.')){
val=val.replace(/^\/+/, '');
val='http://' + val;
}
$(this).val(val);
});
};
wpcf7.submit=function(form){
if(typeof window.FormData!=='function'){
return;
}
var $form=$(form);
$('.ajax-loader', $form).addClass('is-active');
wpcf7.clearResponse($form);
var formData=new FormData($form.get(0));
var detail={
id: $form.closest('div.wpcf7').attr('id'),
status: 'init',
inputs: [],
formData: formData
};
$.each($form.serializeArray(), function(i, field){
if('_wpcf7'==field.name){
detail.contactFormId=field.value;
}else if('_wpcf7_version'==field.name){
detail.pluginVersion=field.value;
}else if('_wpcf7_locale'==field.name){
detail.contactFormLocale=field.value;
}else if('_wpcf7_unit_tag'==field.name){
detail.unitTag=field.value;
}else if('_wpcf7_container_post'==field.name){
detail.containerPostId=field.value;
}else if(field.name.match(/^_wpcf7_\w+_free_text_/)){
var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, '');
detail.inputs.push({
name: owner + '-free-text',
value: field.value
});
}else if(field.name.match(/^_/)){
}else{
detail.inputs.push(field);
}});
wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail);
var ajaxSuccess=function(data, status, xhr, $form){
detail.id=$(data.into).attr('id');
detail.status=data.status;
detail.apiResponse=data;
var $message=$('.wpcf7-response-output', $form);
switch(data.status){
case 'validation_failed':
$.each(data.invalidFields, function(i, n){
$(n.into, $form).each(function(){
wpcf7.notValidTip(this, n.message);
$('.wpcf7-form-control', this).addClass('wpcf7-not-valid');
$('[aria-invalid]', this).attr('aria-invalid', 'true');
});
});
$message.addClass('wpcf7-validation-errors');
$form.addClass('invalid');
wpcf7.triggerEvent(data.into, 'invalid', detail);
break;
case 'acceptance_missing':
$message.addClass('wpcf7-acceptance-missing');
$form.addClass('unaccepted');
wpcf7.triggerEvent(data.into, 'unaccepted', detail);
break;
case 'spam':
$message.addClass('wpcf7-spam-blocked');
$form.addClass('spam');
wpcf7.triggerEvent(data.into, 'spam', detail);
break;
case 'aborted':
$message.addClass('wpcf7-aborted');
$form.addClass('aborted');
wpcf7.triggerEvent(data.into, 'aborted', detail);
break;
case 'mail_sent':
$message.addClass('wpcf7-mail-sent-ok');
$form.addClass('sent');
wpcf7.triggerEvent(data.into, 'mailsent', detail);
break;
case 'mail_failed':
$message.addClass('wpcf7-mail-sent-ng');
$form.addClass('failed');
wpcf7.triggerEvent(data.into, 'mailfailed', detail);
break;
default:
var customStatusClass='custom-'
+ data.status.replace(/[^0-9a-z]+/i, '-');
$message.addClass('wpcf7-' + customStatusClass);
$form.addClass(customStatusClass);
}
wpcf7.refill($form, data);
wpcf7.triggerEvent(data.into, 'submit', detail);
if('mail_sent'==data.status){
$form.each(function(){
this.reset();
});
wpcf7.toggleSubmit($form);
}
if(! wpcf7.supportHtml5.placeholder){
$form.find('[placeholder].placeheld').each(function(i, n){
$(n).val($(n).attr('placeholder'));
});
}
$message.html('').append(data.message).slideDown('fast');
$message.attr('role', 'alert');
$('.screen-reader-response', $form.closest('.wpcf7')).each(function(){
var $response=$(this);
$response.html('').attr('role', '').append(data.message);
if(data.invalidFields){
var $invalids=$('
');
$.each(data.invalidFields, function(i, n){
if(n.idref){
var $li=$('').append($('').attr('href', '#' + n.idref).append(n.message));
}else{
var $li=$('').append(n.message);
}
$invalids.append($li);
});
$response.append($invalids);
}
$response.attr('role', 'alert').focus();
});
};
$.ajax({
type: 'POST',
url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'),
data: formData,
dataType: 'json',
processData: false,
contentType: false
}).done(function(data, status, xhr){
ajaxSuccess(data, status, xhr, $form);
$('.ajax-loader', $form).removeClass('is-active');
}).fail(function(xhr, status, error){
var $e=$('').text(error.message);
$form.after($e);
});
};
wpcf7.triggerEvent=function(target, name, detail){
var $target=$(target);
var event=new CustomEvent('wpcf7' + name, {
bubbles: true,
detail: detail
});
$target.get(0).dispatchEvent(event);
$target.trigger('wpcf7:' + name, detail);
$target.trigger(name + '.wpcf7', detail);
};
wpcf7.toggleSubmit=function(form, state){
var $form=$(form);
var $submit=$('input:submit', $form);
if(typeof state!=='undefined'){
$submit.prop('disabled', ! state);
return;
}
if($form.hasClass('wpcf7-acceptance-as-validation')){
return;
}
$submit.prop('disabled', false);
$('.wpcf7-acceptance', $form).each(function(){
var $span=$(this);
var $input=$('input:checkbox', $span);
if(! $span.hasClass('optional')){
if($span.hasClass('invert')&&$input.is(':checked')
|| ! $span.hasClass('invert')&&! $input.is(':checked')){
$submit.prop('disabled', true);
return false;
}}
});
};
wpcf7.notValidTip=function(target, message){
var $target=$(target);
$('.wpcf7-not-valid-tip', $target).remove();
$('')
.text(message).appendTo($target);
if($target.is('.use-floating-validation-tip *')){
var fadeOut=function(target){
$(target).not(':hidden').animate({
opacity: 0
}, 'fast', function(){
$(this).css({ 'z-index': -100 });
});
};
$target.on('mouseover', '.wpcf7-not-valid-tip', function(){
fadeOut(this);
});
$target.on('focus', ':input', function(){
fadeOut($('.wpcf7-not-valid-tip', $target));
});
}};
wpcf7.refill=function(form, data){
var $form=$(form);
var refillCaptcha=function($form, items){
$.each(items, function(i, n){
$form.find(':input[name="' + i + '"]').val('');
$form.find('img.wpcf7-captcha-' + i).attr('src', n);
var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);
$form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]);
});
};
var refillQuiz=function($form, items){
$.each(items, function(i, n){
$form.find(':input[name="' + i + '"]').val('');
$form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]);
$form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]);
});
};
if(typeof data==='undefined'){
$.ajax({
type: 'GET',
url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'),
beforeSend: function(xhr){
var nonce=$form.find(':input[name="_wpnonce"]').val();
if(nonce){
xhr.setRequestHeader('X-WP-Nonce', nonce);
}},
dataType: 'json'
}).done(function(data, status, xhr){
if(data.captcha){
refillCaptcha($form, data.captcha);
}
if(data.quiz){
refillQuiz($form, data.quiz);
}});
}else{
if(data.captcha){
refillCaptcha($form, data.captcha);
}
if(data.quiz){
refillQuiz($form, data.quiz);
}}
};
wpcf7.clearResponse=function(form){
var $form=$(form);
$form.removeClass('invalid spam sent failed');
$form.siblings('.screen-reader-response').html('').attr('role', '');
$('.wpcf7-not-valid-tip', $form).remove();
$('[aria-invalid]', $form).attr('aria-invalid', 'false');
$('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid');
$('.wpcf7-response-output', $form)
.hide().empty().removeAttr('role')
.removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
};
wpcf7.apiSettings.getRoute=function(path){
var url=wpcf7.apiSettings.root;
url=url.replace(wpcf7.apiSettings.namespace,
wpcf7.apiSettings.namespace + path);
return url;
};})(jQuery);
(function (){
if(typeof window.CustomEvent==="function") return false;
function CustomEvent(event, params){
params=params||{ bubbles: false, cancelable: false, detail: undefined };
var evt=document.createEvent('CustomEvent');
evt.initCustomEvent(event,
params.bubbles, params.cancelable, params.detail);
return evt;
}
CustomEvent.prototype=window.Event.prototype;
window.CustomEvent=CustomEvent;
})();
jQuery(document).ready(function($){
$('body').on('click','.newave-like', function(){
var $likeLink=$(this);
var $id=$(this).attr('id');
var $that=$(this);
if($likeLink.hasClass('liked')) return false;
if($(this).hasClass('inactive')) return false;
var $dataToPass={
action: 'newave-like',
likes_id: $id
}
$.post(newaveLike.ajaxurl, $dataToPass, function(data){
$likeLink.find('span').html(data);
$likeLink.addClass('loved').attr('title','You already like this!');
$likeLink.find('span').css({'opacity': 1,'width':'auto'});
});
$(this).addClass('inactive');
return false;
});
});
(function($){
var defaults={
topSpacing: 0,
bottomSpacing: 0,
className: 'is-sticky',
wrapperClassName: 'sticky-wrapper'
},
$window=$(window),
$document=$(document),
sticked=[],
windowHeight=$window.height(),
scroller=function(){
var scrollTop=$window.scrollTop(),
documentHeight=$document.height(),
dwh=documentHeight - windowHeight,
extra=(scrollTop > dwh) ? dwh - scrollTop:0;
for (var i=0; i < sticked.length; i++){
var s=sticked[i],
elementTop=s.stickyWrapper.offset().top,
etse=elementTop - s.topSpacing - extra;
if(scrollTop <=etse){
if(s.currentTop!==null){
s.stickyElement
.css('position', '')
.css('top', '')
.removeClass(s.className);
s.stickyElement.parent().removeClass(s.className);
s.currentTop=null;
}}else{
var newTop=documentHeight - s.stickyElement.outerHeight()
- s.topSpacing - s.bottomSpacing - scrollTop - extra;
if(newTop < 0){
newTop=newTop + s.topSpacing;
}else{
newTop=s.topSpacing;
}
if(s.currentTop!=newTop){
s.stickyElement
.css('position', 'fixed')
.css('top', newTop)
.addClass(s.className);
s.stickyElement.parent().addClass(s.className);
s.currentTop=newTop;
}}
}},
resizer=function(){
windowHeight=$window.height();
},
methods={
init: function(options){
var o=$.extend(defaults, options);
return this.each(function(){
var stickyElement=$(this);
stickyId=stickyElement.attr('id');
wrapper=$('')
.attr('id', stickyId + '-sticky-wrapper')
.addClass(o.wrapperClassName);
stickyElement.wrapAll(wrapper);
var stickyWrapper=stickyElement.parent();
stickyWrapper.css('height', stickyElement.outerHeight());
sticked.push({
topSpacing: o.topSpacing,
bottomSpacing: o.bottomSpacing,
stickyElement: stickyElement,
currentTop: null,
stickyWrapper: stickyWrapper,
className: o.className
});
});
},
update: scroller
};
if(window.addEventListener){
window.addEventListener('scroll', scroller, false);
window.addEventListener('resize', resizer, false);
}else if(window.attachEvent){
window.attachEvent('onscroll', scroller);
window.attachEvent('onresize', resizer);
}
$.fn.sticky=function(method){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}else if(typeof method==='object'||!method){
return methods.init.apply(this, arguments);
}else{
$.error('Method ' + method + ' does not exist on jQuery.sticky');
}};
$(function(){
setTimeout(scroller, 0);
});
})(jQuery);
jQuery.easing['jswing']=jQuery.easing['swing'];
jQuery.extend(jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d){
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d){
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d){
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d){
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d){
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d){
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d){
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d){
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d){
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d){
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d){
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d){
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d){
return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d){
return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d){
if(t==0) return b;
if(t==d) return b+c;
if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d){
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d){
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d){
if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
},
easeOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b;
},
easeInOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5);
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d){
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d){
if((t/=d) < (1/2.75)){
return c*(7.5625*t*t) + b;
}else if(t < (2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
}else if(t < (2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}},
easeInOutBounce: function (x, t, b, c, d){
if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}});
! function (e){
e(function (){
"use strict";
e.support.transition=function (){
var e=function (){
var e=document.createElement("bootstrap"),
t={
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd otransitionend",
transition: "transitionend"
}, n;
for (n in t)
if(e.style[n]!==undefined) return t[n]
}();
return e&&{
end: e
}}()
})
}(window.jQuery), ! function (e){
"use strict";
var t='[data-dismiss="alert"]',
n=function (n){
e(n).on("click", t, this.close)
};
n.prototype.close=function (t){
function s(){
i.trigger("closed").remove()
}
var n=e(this),
r=n.attr("data-target"),
i;
r||(r=n.attr("href"), r=r&&r.replace(/.*(?=#[^\s]*$)/, "")), i=e(r), t&&t.preventDefault(), i.length||(i=n.hasClass("alert") ? n:n.parent()), i.trigger(t=e.Event("close"));
if(t.isDefaultPrevented()) return;
i.removeClass("in"), e.support.transition&&i.hasClass("fade") ? i.on(e.support.transition.end, s):s()
}, e.fn.alert=function (t){
return this.each(function (){
var r=e(this),
i=r.data("alert");
i||r.data("alert", i=new n(this)), typeof t=="string"&&i[t].call(r)
})
}, e.fn.alert.Constructor=n, e(function (){
e("body").on("click.alert.data-api", t, n.prototype.close)
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t, n){
this.$element=e(t), this.options=e.extend({}, e.fn.button.defaults, n)
};
t.prototype.setState=function (e){
var t="disabled",
n=this.$element,
r=n.data(),
i=n.is("input") ? "val":"html";
e +="Text", r.resetText||n.data("resetText", n[i]()), n[i](r[e]||this.options[e]), setTimeout(function (){
e=="loadingText" ? n.addClass(t).attr(t, t):n.removeClass(t).removeAttr(t)
}, 0)
}, t.prototype.toggle=function (){
var e=this.$element.closest('[data-toggle="buttons-radio"]');
e&&e.find(".active").removeClass("active"), this.$element.toggleClass("active")
}, e.fn.button=function (n){
return this.each(function (){
var r=e(this),
i=r.data("button"),
s=typeof n=="object"&&n;
i||r.data("button", i=new t(this, s)), n=="toggle" ? i.toggle():n&&i.setState(n)
})
}, e.fn.button.defaults={
loadingText: "loading..."
}, e.fn.button.Constructor=t, e(function (){
e("body").on("click.button.data-api", "[data-toggle^=button]", function (t){
var n=e(t.target);
n.hasClass("btn")||(n=n.closest(".btn")), n.button("toggle")
})
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t, n){
this.$element=e(t), this.options=n, this.options.slide&&this.slide(this.options.slide), this.options.pause=="hover"&&this.$element.on("mouseenter", e.proxy(this.pause, this)).on("mouseleave", e.proxy(this.cycle, this))
};
t.prototype={
cycle: function (t){
return t||(this.paused = !1), this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next, this), this.options.interval)), this
},
to: function (t){
var n=this.$element.find(".item.active"),
r=n.parent().children(),
i=r.index(n),
s=this;
if(t > r.length - 1||t < 0) return;
return this.sliding ? this.$element.one("slid", function (){
s.to(t)
}):i==t ? this.pause().cycle():this.slide(t > i ? "next":"prev", e(r[t]))
},
pause: function (t){
return t||(this.paused = !0), this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end), this.cycle()), clearInterval(this.interval), this.interval=null, this
},
next: function (){
if(this.sliding) return;
return this.slide("next")
},
prev: function (){
if(this.sliding) return;
return this.slide("prev")
},
slide: function (t, n){
var r=this.$element.find(".item.active"),
i=n||r[t](),
s=this.interval,
o=t=="next" ? "left":"right",
u=t=="next" ? "first":"last",
a=this,
f=e.Event("slide", {
relatedTarget: i[0]
});
this.sliding = !0, s&&this.pause(), i=i.length ? i:this.$element.find(".item")[u]();
if(i.hasClass("active")) return;
if(e.support.transition&&this.$element.hasClass("slide")){
this.$element.trigger(f);
if(f.isDefaultPrevented()) return;
i.addClass(t), i[0].offsetWidth, r.addClass(o), i.addClass(o), this.$element.one(e.support.transition.end, function (){
i.removeClass([t, o].join(" ")).addClass("active"), r.removeClass(["active", o].join(" ")), a.sliding = !1, setTimeout(function (){
a.$element.trigger("slid")
}, 0)
})
}else{
this.$element.trigger(f);
if(f.isDefaultPrevented()) return;
r.removeClass("active"), i.addClass("active"), this.sliding = !1, this.$element.trigger("slid")
}
return s&&this.cycle(), this
}}, e.fn.carousel=function (n){
return this.each(function (){
var r=e(this),
i=r.data("carousel"),
s=e.extend({}, e.fn.carousel.defaults, typeof n=="object"&&n),
o=typeof n=="string" ? n:s.slide;
i||r.data("carousel", i=new t(this, s)), typeof n=="number" ? i.to(n):o ? i[o]():s.interval&&i.cycle()
})
}, e.fn.carousel.defaults={
interval: 5e3,
pause: "hover"
}, e.fn.carousel.Constructor=t, e(function (){
e("body").on("click.carousel.data-api", "[data-slide]", function (t){
var n=e(this),
r, i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/, "")),
s = !i.data("modal")&&e.extend({}, i.data(), n.data());
i.carousel(s), t.preventDefault()
})
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t, n){
this.$element=e(t), this.options=e.extend({}, e.fn.collapse.defaults, n), this.options.parent&&(this.$parent=e(this.options.parent)), this.options.toggle&&this.toggle()
};
t.prototype={
constructor: t,
dimension: function (){
var e=this.$element.hasClass("width");
return e ? "width":"height"
},
show: function (){
var t, n, r, i;
if(this.transitioning) return;
t=this.dimension(), n=e.camelCase(["scroll", t].join("-")), r=this.$parent&&this.$parent.find("> .accordion-group > .in");
if(r&&r.length){
i=r.data("collapse");
if(i&&i.transitioning) return;
r.collapse("hide"), i||r.data("collapse", null)
}
this.$element[t](0), this.transition("addClass", e.Event("show"), "shown"), e.support.transition&&this.$element[t](this.$element[0][n])
},
hide: function (){
var t;
if(this.transitioning) return;
t=this.dimension(), this.reset(this.$element[t]()), this.transition("removeClass", e.Event("hide"), "hidden"), this.$element[t](0)
},
reset: function (e){
var t=this.dimension();
return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth, this.$element[e!==null ? "addClass":"removeClass"]("collapse"), this
},
transition: function (t, n, r){
var i=this,
s=function (){
n.type=="show"&&i.reset(), i.transitioning=0, i.$element.trigger(r)
};
this.$element.trigger(n);
if(n.isDefaultPrevented()) return;
this.transitioning=1, this.$element[t]("in"), e.support.transition&&this.$element.hasClass("collapse") ? this.$element.one(e.support.transition.end, s):s()
},
toggle: function (){
this[this.$element.hasClass("in") ? "hide":"show"]()
}}, e.fn.collapse=function (n){
return this.each(function (){
var r=e(this),
i=r.data("collapse"),
s=typeof n=="object"&&n;
i||r.data("collapse", i=new t(this, s)), typeof n=="string"&&i[n]()
})
}, e.fn.collapse.defaults={
toggle: !0
}, e.fn.collapse.Constructor=t, e(function (){
e("body").on("click.collapse.data-api", "[data-toggle=collapse]", function (t){
var n=e(this),
r, i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/, ""),
s=e(i).data("collapse") ? "toggle":n.data();
n[e(i).hasClass("in") ? "addClass":"removeClass"]("collapsed"), e(i).collapse(s)
})
})
}(window.jQuery), ! function (e){
"use strict";
function r(){
i(e(t)).removeClass("open")
}
function i(t){
var n=t.attr("data-target"),
r;
return n||(n=t.attr("href"), n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/, "")), r=e(n), r.length||(r=t.parent()), r
}
var t="[data-toggle=dropdown]",
n=function (t){
var n=e(t).on("click.dropdown.data-api", this.toggle);
e("html").on("click.dropdown.data-api", function (){
n.parent().removeClass("open")
})
};
n.prototype={
constructor: n,
toggle: function (t){
var n=e(this),
s, o;
if(n.is(".disabled, :disabled")) return;
return s=i(n), o=s.hasClass("open"), r(), o||(s.toggleClass("open"), n.focus()), !1
},
keydown: function (t){
var n, r, s, o, u, a;
if(!/(38|40|27)/.test(t.keyCode)) return;
n=e(this), t.preventDefault(), t.stopPropagation();
if(n.is(".disabled, :disabled")) return;
o=i(n), u=o.hasClass("open");
if(!u||u&&t.keyCode==27) return n.click();
r=e("[role=menu] li:not(.divider) a", o);
if(!r.length) return;
a=r.index(r.filter(":focus")), t.keyCode==38&&a > 0&&a--, t.keyCode==40&&a < r.length - 1&&a++, ~a||(a=0), r.eq(a).focus()
}}, e.fn.dropdown=function (t){
return this.each(function (){
var r=e(this),
i=r.data("dropdown");
i||r.data("dropdown", i=new n(this)), typeof t=="string"&&i[t].call(r)
})
}, e.fn.dropdown.Constructor=n, e(function (){
e("html").on("click.dropdown.data-api touchstart.dropdown.data-api", r), e("body").on("click.dropdown touchstart.dropdown.data-api", ".dropdown form", function (e){
e.stopPropagation()
}).on("click.dropdown.data-api touchstart.dropdown.data-api", t, n.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api", t + ", [role=menu]", n.prototype.keydown)
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t, n){
this.options=n, this.$element=e(t).delegate('[data-dismiss="modal"]', "click.dismiss.modal", e.proxy(this.hide, this)), this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)
};
t.prototype={
constructor: t,
toggle: function (){
return this[this.isShown ? "hide":"show"]()
},
show: function (){
var t=this,
n=e.Event("show");
this.$element.trigger(n);
if(this.isShown||n.isDefaultPrevented()) return;
e("body").addClass("modal-open"), this.isShown = !0, this.escape(), this.backdrop(function (){
var n=e.support.transition&&t.$element.hasClass("fade");
t.$element.parent().length||t.$element.appendTo(document.body), t.$element.show(), n&&t.$element[0].offsetWidth, t.$element.addClass("in").attr("aria-hidden", !1).focus(), t.enforceFocus(), n ? t.$element.one(e.support.transition.end, function (){
t.$element.trigger("shown")
}):t.$element.trigger("shown")
})
},
hide: function (t){
t&&t.preventDefault();
var n=this;
t=e.Event("hide"), this.$element.trigger(t);
if(!this.isShown||t.isDefaultPrevented()) return;
this.isShown = !1, e("body").removeClass("modal-open"), this.escape(), e(document).off("focusin.modal"), this.$element.removeClass("in").attr("aria-hidden", !0), e.support.transition&&this.$element.hasClass("fade") ? this.hideWithTransition():this.hideModal()
},
enforceFocus: function (){
var t=this;
e(document).on("focusin.modal", function (e){
t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()
})
},
escape: function (){
var e=this;
this.isShown&&this.options.keyboard ? this.$element.on("keyup.dismiss.modal", function (t){
t.which==27&&e.hide()
}):this.isShown||this.$element.off("keyup.dismiss.modal")
},
hideWithTransition: function (){
var t=this,
n=setTimeout(function (){
t.$element.off(e.support.transition.end), t.hideModal()
}, 500);
this.$element.one(e.support.transition.end, function (){
clearTimeout(n), t.hideModal()
})
},
hideModal: function (e){
this.$element.hide().trigger("hidden"), this.backdrop()
},
removeBackdrop: function (){
this.$backdrop.remove(), this.$backdrop=null
},
backdrop: function (t){
var n=this,
r=this.$element.hasClass("fade") ? "fade":"";
if(this.isShown&&this.options.backdrop){
var i=e.support.transition&&r;
this.$backdrop=e('').appendTo(document.body), this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide, this)), i&&this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), i ? this.$backdrop.one(e.support.transition.end, t):t()
} else !this.isShown&&this.$backdrop ? (this.$backdrop.removeClass("in"), e.support.transition&&this.$element.hasClass("fade") ? this.$backdrop.one(e.support.transition.end, e.proxy(this.removeBackdrop, this)):this.removeBackdrop()):t&&t()
}}, e.fn.modal=function (n){
return this.each(function (){
var r=e(this),
i=r.data("modal"),
s=e.extend({}, e.fn.modal.defaults, r.data(), typeof n=="object"&&n);
i||r.data("modal", i=new t(this, s)), typeof n=="string" ? i[n]():s.show&&i.show()
})
}, e.fn.modal.defaults={
backdrop: !0,
keyboard: !0,
show: !0
}, e.fn.modal.Constructor=t, e(function (){
e("body").on("click.modal.data-api", '[data-toggle="modal"]', function (t){
var n=e(this),
r=n.attr("href"),
i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/, "")),
s=i.data("modal") ? "toggle":e.extend({
remote: !/#/.test(r)&&r
}, i.data(), n.data());
t.preventDefault(), i.modal(s).one("hide", function (){
n.focus()
})
})
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (e, t){
this.init("tooltip", e, t)
};
t.prototype={
constructor: t,
init: function (t, n, r){
var i, s;
this.type=t, this.$element=e(n), this.options=this.getOptions(r), this.enabled = !0, this.options.trigger=="click" ? this.$element.on("click." + this.type, this.options.selector, e.proxy(this.toggle, this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover" ? "mouseenter":"focus", s=this.options.trigger=="hover" ? "mouseleave":"blur", this.$element.on(i + "." + this.type, this.options.selector, e.proxy(this.enter, this)), this.$element.on(s + "." + this.type, this.options.selector, e.proxy(this.leave, this))), this.options.selector ? this._options=e.extend({}, this.options, {
trigger: "manual",
selector: ""
}):this.fixTitle()
},
getOptions: function (t){
return t=e.extend({}, e.fn[this.type].defaults, t, this.$element.data()), t.delay&&typeof t.delay=="number"&&(t.delay={
show: t.delay,
hide: t.delay
}), t
},
enter: function (t){
var n=e(t.currentTarget)[this.type](this._options).data(this.type);
if(!n.options.delay||!n.options.delay.show) return n.show();
clearTimeout(this.timeout), n.hoverState="in", this.timeout=setTimeout(function (){
n.hoverState=="in"&&n.show()
}, n.options.delay.show)
},
leave: function (t){
var n=e(t.currentTarget)[this.type](this._options).data(this.type);
this.timeout&&clearTimeout(this.timeout);
if(!n.options.delay||!n.options.delay.hide) return n.hide();
n.hoverState="out", this.timeout=setTimeout(function (){
n.hoverState=="out"&&n.hide()
}, n.options.delay.hide)
},
show: function (){
var e, t, n, r, i, s, o;
if(this.hasContent()&&this.enabled){
e=this.tip(), this.setContent(), this.options.animation&&e.addClass("fade"), s=typeof this.options.placement=="function" ? this.options.placement.call(this, e[0], this.$element[0]):this.options.placement, t=/in/.test(s), e.remove().css({
top: 0,
left: 0,
display: "block"
}).appendTo(t ? this.$element:document.body), n=this.getPosition(t), r=e[0].offsetWidth, i=e[0].offsetHeight;
switch (t ? s.split(" ")[1]:s){
case "bottom":
o={
top: n.top + n.height,
left: n.left + n.width / 2 - r / 2
};
break;
case "top":
o={
top: n.top - i,
left: n.left + n.width / 2 - r / 2
};
break;
case "left":
o={
top: n.top + n.height / 2 - i / 2,
left: n.left - r
};
break;
case "right":
o={
top: n.top + n.height / 2 - i / 2,
left: n.left + n.width
}}
e.css(o).addClass(s).addClass("in")
}},
setContent: function (){
var e=this.tip(),
t=this.getTitle();
e.find(".tooltip-inner")[this.options.html ? "html":"text"](t), e.removeClass("fade in top bottom left right")
},
hide: function (){
function r(){
var t=setTimeout(function (){
n.off(e.support.transition.end).remove()
}, 500);
n.one(e.support.transition.end, function (){
clearTimeout(t), n.remove()
})
}
var t=this,
n=this.tip();
return n.removeClass("in"), e.support.transition&&this.$tip.hasClass("fade") ? r():n.remove(), this
},
fixTitle: function (){
var e=this.$element;
(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title", e.attr("title")||"").removeAttr("title")
},
hasContent: function (){
return this.getTitle()
},
getPosition: function (t){
return e.extend({}, t ? {
top: 0,
left: 0
}:this.$element.offset(), {
width: this.$element[0].offsetWidth,
height: this.$element[0].offsetHeight
})
},
getTitle: function (){
var e, t=this.$element,
n=this.options;
return e=t.attr("data-original-title")||(typeof n.title=="function" ? n.title.call(t[0]):n.title), e
},
tip: function (){
return this.$tip=this.$tip||e(this.options.template)
},
validate: function (){
this.$element[0].parentNode||(this.hide(), this.$element=null, this.options=null)
},
enable: function (){
this.enabled = !0
},
disable: function (){
this.enabled = !1
},
toggleEnabled: function (){
this.enabled = !this.enabled
},
toggle: function (){
this[this.tip().hasClass("in") ? "hide":"show"]()
},
destroy: function (){
this.hide().$element.off("." + this.type).removeData(this.type)
}}, e.fn.tooltip=function (n){
return this.each(function (){
var r=e(this),
i=r.data("tooltip"),
s=typeof n=="object"&&n;
i||r.data("tooltip", i=new t(this, s)), typeof n=="string"&&i[n]()
})
}, e.fn.tooltip.Constructor=t, e.fn.tooltip.defaults={
animation: !0,
placement: "top",
selector: !1,
template: '',
trigger: "hover",
title: "",
delay: 0,
html: !0
}}(window.jQuery), ! function (e){
"use strict";
var t=function (e, t){
this.init("popover", e, t)
};
t.prototype=e.extend({}, e.fn.tooltip.Constructor.prototype, {
constructor: t,
setContent: function (){
var e=this.tip(),
t=this.getTitle(),
n=this.getContent();
e.find(".popover-title")[this.options.html ? "html":"text"](t), e.find(".popover-content > *")[this.options.html ? "html":"text"](n), e.removeClass("fade top bottom left right in")
},
hasContent: function (){
return this.getTitle()||this.getContent()
},
getContent: function (){
var e, t=this.$element,
n=this.options;
return e=t.attr("data-content")||(typeof n.content=="function" ? n.content.call(t[0]):n.content), e
},
tip: function (){
return this.$tip||(this.$tip=e(this.options.template)), this.$tip
},
destroy: function (){
this.hide().$element.off("." + this.type).removeData(this.type)
}}), e.fn.popover=function (n){
return this.each(function (){
var r=e(this),
i=r.data("popover"),
s=typeof n=="object"&&n;
i||r.data("popover", i=new t(this, s)), typeof n=="string"&&i[n]()
})
}, e.fn.popover.Constructor=t, e.fn.popover.defaults=e.extend({}, e.fn.tooltip.defaults, {
placement: "right",
trigger: "click",
content: "",
template: ''
})
}(window.jQuery), ! function (e){
"use strict";
function t(t, n){
var r=e.proxy(this.process, this),
i=e(t).is("body") ? e(window):e(t),
s;
this.options=e.extend({}, e.fn.scrollspy.defaults, n), this.$scrollElement=i.on("scroll.scroll-spy.data-api", r), this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/, "")||"") + " .nav li > a", this.$body=e("body"), this.refresh(), this.process()
}
t.prototype={
constructor: t,
refresh: function (){
var t=this,
n;
this.offsets=e([]), this.targets=e([]), n=this.$body.find(this.selector).map(function (){
var t=e(this),
n=t.data("target")||t.attr("href"),
r=/^#\w/.test(n)&&e(n);
return r&&r.length&&[
[r.position().top, n]
]||null
}).sort(function (e, t){
return e[0] - t[0]
}).each(function (){
t.offsets.push(this[0]), t.targets.push(this[1])
})
},
process: function (){
var e=this.$scrollElement.scrollTop() + this.options.offset,
t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,
n=t - this.$scrollElement.height(),
r=this.offsets,
i=this.targets,
s=this.activeTarget,
o;
if(e >=n) return s!=(o=i.last()[0])&&this.activate(o);
for (o=r.length; o--;) s!=i[o]&&e >=r[o]&&(!r[o + 1]||e <=r[o + 1])&&this.activate(i[o])
},
activate: function (t){
var n, r;
this.activeTarget=t, e(this.selector).parent(".active").removeClass("active"), r=this.selector + '[data-target="' + t + '"],' + this.selector + '[href="' + t + '"]', n=e(r).parent("li").addClass("active"), n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")), n.trigger("activate")
}}, e.fn.scrollspy=function (n){
return this.each(function (){
var r=e(this),
i=r.data("scrollspy"),
s=typeof n=="object"&&n;
i||r.data("scrollspy", i=new t(this, s)), typeof n=="string"&&i[n]()
})
}, e.fn.scrollspy.Constructor=t, e.fn.scrollspy.defaults={
offset: 10
}, e(window).on("load", function (){
e('[data-spy="scroll"]').each(function (){
var t=e(this);
t.scrollspy(t.data())
})
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t){
this.element=e(t)
};
t.prototype={
constructor: t,
show: function (){
var t=this.element,
n=t.closest("ul:not(.dropdown-menu)"),
r=t.attr("data-target"),
i, s, o;
r||(r=t.attr("href"), r=r&&r.replace(/.*(?=#[^\s]*$)/, ""));
if(t.parent("li").hasClass("active")) return;
i=n.find(".active a").last()[0], o=e.Event("show", {
relatedTarget: i
}), t.trigger(o);
if(o.isDefaultPrevented()) return;
s=e(r), this.activate(t.parent("li"), n), this.activate(s, s.parent(), function (){
t.trigger({
type: "shown",
relatedTarget: i
})
})
},
activate: function (t, n, r){
function o(){
i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), t.addClass("active"), s ? (t[0].offsetWidth, t.addClass("in")):t.removeClass("fade"), t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"), r&&r()
}
var i=n.find("> .active"),
s=r&&e.support.transition&&i.hasClass("fade");
s ? i.one(e.support.transition.end, o):o(), i.removeClass("in")
}}, e.fn.tab=function (n){
return this.each(function (){
var r=e(this),
i=r.data("tab");
i||r.data("tab", i=new t(this)), typeof n=="string"&&i[n]()
})
}, e.fn.tab.Constructor=t, e(function (){
e("body").on("click.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function (t){
t.preventDefault(), e(this).tab("show")
})
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t, n){
this.$element=e(t), this.options=e.extend({}, e.fn.typeahead.defaults, n), this.matcher=this.options.matcher||this.matcher, this.sorter=this.options.sorter||this.sorter, this.highlighter=this.options.highlighter||this.highlighter, this.updater=this.options.updater||this.updater, this.$menu=e(this.options.menu).appendTo("body"), this.source=this.options.source, this.shown = !1, this.listen()
};
t.prototype={
constructor: t,
select: function (){
var e=this.$menu.find(".active").attr("data-value");
return this.$element.val(this.updater(e)).change(), this.hide()
},
updater: function (e){
return e
},
show: function (){
var t=e.extend({}, this.$element.offset(), {
height: this.$element[0].offsetHeight
});
return this.$menu.css({
top: t.top + t.height,
left: t.left
}), this.$menu.show(), this.shown = !0, this
},
hide: function (){
return this.$menu.hide(), this.shown = !1, this
},
lookup: function (t){
var n;
return this.query=this.$element.val(), !this.query||this.query.length < this.options.minLength ? this.shown ? this.hide():this:(n=e.isFunction(this.source) ? this.source(this.query, e.proxy(this.process, this)):this.source, n ? this.process(n):this)
},
process: function (t){
var n=this;
return t=e.grep(t, function (e){
return n.matcher(e)
}), t=this.sorter(t), t.length ? this.render(t.slice(0, this.options.items)).show():this.shown ? this.hide():this
},
matcher: function (e){
return~ e.toLowerCase().indexOf(this.query.toLowerCase())
},
sorter: function (e){
var t=[],
n=[],
r=[],
i;
while (i=e.shift()) i.toLowerCase().indexOf(this.query.toLowerCase()) ? ~i.indexOf(this.query) ? n.push(i):r.push(i):t.push(i);
return t.concat(n, r)
},
highlighter: function (e){
var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
return e.replace(new RegExp("(" + t + ")", "ig"), function (e, t){
return "" + t + ""
})
},
render: function (t){
var n=this;
return t=e(t).map(function (t, r){
return t=e(n.options.item).attr("data-value", r), t.find("a").html(n.highlighter(r)), t[0]
}), t.first().addClass("active"), this.$menu.html(t), this
},
next: function (t){
var n=this.$menu.find(".active").removeClass("active"),
r=n.next();
r.length||(r=e(this.$menu.find("li")[0])), r.addClass("active")
},
prev: function (e){
var t=this.$menu.find(".active").removeClass("active"),
n=t.prev();
n.length||(n=this.$menu.find("li").last()), n.addClass("active")
},
listen: function (){
this.$element.on("blur", e.proxy(this.blur, this)).on("keypress", e.proxy(this.keypress, this)).on("keyup", e.proxy(this.keyup, this)), (e.browser.chrome||e.browser.webkit||e.browser.msie)&&this.$element.on("keydown", e.proxy(this.keydown, this)), this.$menu.on("click", e.proxy(this.click, this)).on("mouseenter", "li", e.proxy(this.mouseenter, this))
},
move: function (e){
if(!this.shown) return;
switch (e.keyCode){
case 9:
case 13:
case 27:
e.preventDefault();
break;
case 38:
e.preventDefault(), this.prev();
break;
case 40:
e.preventDefault(), this.next()
}
e.stopPropagation()
},
keydown: function (t){
this.suppressKeyPressRepeat = !~e.inArray(t.keyCode, [40, 38, 9, 13, 27]), this.move(t)
},
keypress: function (e){
if(this.suppressKeyPressRepeat) return;
this.move(e)
},
keyup: function (e){
switch (e.keyCode){
case 40:
case 38:
break;
case 9:
case 13:
if(!this.shown) return;
this.select();
break;
case 27:
if(!this.shown) return;
this.hide();
break;
default:
this.lookup()
}
e.stopPropagation(), e.preventDefault()
},
blur: function (e){
var t=this;
setTimeout(function (){
t.hide()
}, 150)
},
click: function (e){
e.stopPropagation(), e.preventDefault(), this.select()
},
mouseenter: function (t){
this.$menu.find(".active").removeClass("active"), e(t.currentTarget).addClass("active")
}}, e.fn.typeahead=function (n){
return this.each(function (){
var r=e(this),
i=r.data("typeahead"),
s=typeof n=="object"&&n;
i||r.data("typeahead", i=new t(this, s)), typeof n=="string"&&i[n]()
})
}, e.fn.typeahead.defaults={
source: [],
items: 8,
menu: '',
item: '',
minLength: 1
}, e.fn.typeahead.Constructor=t, e(function (){
e("body").on("focus.typeahead.data-api", '[data-provide="typeahead"]', function (t){
var n=e(this);
if(n.data("typeahead")) return;
t.preventDefault(), n.typeahead(n.data())
})
})
}(window.jQuery), ! function (e){
"use strict";
var t=function (t, n){
this.options=e.extend({}, e.fn.affix.defaults, n), this.$window=e(window).on("scroll.affix.data-api", e.proxy(this.checkPosition, this)), this.$element=e(t), this.checkPosition()
};
t.prototype.checkPosition=function (){
if(!this.$element.is(":visible")) return;
var t=e(document).height(),
n=this.$window.scrollTop(),
r=this.$element.offset(),
i=this.options.offset,
s=i.bottom,
o=i.top,
u="affix affix-top affix-bottom",
a;
typeof i!="object"&&(s=o = i), typeof o=="function"&&(o=i.top()), typeof s=="function"&&(s=i.bottom()), a=this.unpin!=null&&n + this.unpin <=r.top ? !1:s!=null&&r.top + this.$element.height() >=t - s ? "bottom":o!=null&&n <=o ? "top":!1;
if(this.affixed===a) return;
this.affixed=a, this.unpin=a=="bottom" ? r.top - n:null, this.$element.removeClass(u).addClass("affix" + (a ? "-" + a:""))
}, e.fn.affix=function (n){
return this.each(function (){
var r=e(this),
i=r.data("affix"),
s=typeof n=="object"&&n;
i||r.data("affix", i=new t(this, s)), typeof n=="string"&&i[n]()
})
}, e.fn.affix.Constructor=t, e.fn.affix.defaults={
offset: 0
}, e(window).on("load", function (){
e('[data-spy="affix"]').each(function (){
var t=e(this),
n=t.data();
n.offset=n.offset||{}, n.offsetBottom&&(n.offset.bottom=n.offsetBottom), n.offsetTop&&(n.offset.top=n.offsetTop), t.affix(n)
})
})
}(window.jQuery);
(function($){
var $window=$(window);
var windowHeight=$window.height();
$window.resize(function (){
windowHeight=$window.height();
});
$.fn.parallax=function(xpos, speedFactor, outerHeight){
var $this=$(this);
var getHeight;
var firstTop;
var paddingTop=0;
function update (){
$this.each(function(){
firstTop=$this.offset().top;
});
if(outerHeight){
getHeight=function(jqo){
return jqo.outerHeight(true);
};}else{
getHeight=function(jqo){
return jqo.height();
};}
if(arguments.length < 1||xpos===null) xpos="50%";
if(arguments.length < 2||speedFactor===null) speedFactor=0.5;
if(arguments.length < 3||outerHeight===null) outerHeight=true;
var pos=$window.scrollTop();
$this.each(function(){
var $element=$(this);
var top=$element.offset().top;
var height=getHeight($element);
if(top + height < pos||top > pos + windowHeight){
return;
}
$this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px");
});
}
$window.bind('scroll', update).resize(update);
update();
};})(jQuery);
(function($){
$.fn.appear=function(fn, options){
var settings=$.extend({
data: undefined,
one: true,
accX: 0,
accY: 0
}, options);
return this.each(function(){
var t=$(this);
t.appeared=false;
if(!fn){
t.trigger('appear', settings.data);
return;
}
var w=$(window);
var check=function(){
if(!t.is(':visible')){
t.appeared=false;
return;
}
var a=w.scrollLeft();
var b=w.scrollTop();
var o=t.offset();
var x=o.left;
var y=o.top;
var ax=settings.accX;
var ay=settings.accY;
var th=t.height();
var wh=w.height();
var tw=t.width();
var ww=w.width();
if(y + th + ay >=b &&
y <=b + wh + ay &&
x + tw + ax >=a &&
x <=a + ww + ax){
if(!t.appeared) t.trigger('appear', settings.data);
}else{
t.appeared=false;
}};
var modifiedFn=function(){
t.appeared=true;
if(settings.one){
w.unbind('scroll', check);
var i=$.inArray(check, $.fn.appear.checks);
if(i >=0) $.fn.appear.checks.splice(i, 1);
}
fn.apply(this, arguments);
};
if(settings.one) t.one('appear', settings.data, modifiedFn);
else t.bind('appear', settings.data, modifiedFn);
w.scroll(check);
$.fn.appear.checks.push(check);
(check)();
});
};
$.extend($.fn.appear, {
checks: [],
timeout: null,
checkAll: function(){
var length=$.fn.appear.checks.length;
if(length > 0) while (length--) ($.fn.appear.checks[length])();
},
run: function(){
if($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
$.fn.appear.timeout=setTimeout($.fn.appear.checkAll, 20);
}});
$.each(['append', 'prepend', 'after', 'before', 'attr',
'removeAttr', 'addClass', 'removeClass', 'toggleClass',
'remove', 'css', 'show', 'hide'], function(i, n){
var old=$.fn[n];
if(old){
$.fn[n]=function(){
var r=old.apply(this, arguments);
$.fn.appear.run();
return r;
}}
});
})(jQuery);
(function($){
$.fn.countTo=function(options){
options=$.extend({}, $.fn.countTo.defaults, options||{});
var loops=Math.ceil(options.speed / options.refreshInterval),
increment=(options.to - options.from) / loops;
return $(this).each(function(){
var _this=this,
loopCount=0,
value=options.from,
interval=setInterval(updateTimer, options.refreshInterval);
function updateTimer(){
value +=increment;
loopCount++;
$(_this).html(value.toFixed(options.decimals));
if(typeof(options.onUpdate)=='function'){
options.onUpdate.call(_this, value);
}
if(loopCount >=loops){
clearInterval(interval);
value=options.to;
if(typeof(options.onComplete)=='function'){
options.onComplete.call(_this, value);
}}
}});
};
$.fn.countTo.defaults={
from: 0,
to: 100,
speed: 1000,
refreshInterval: 100,
decimals: 0,
onUpdate: null,
onComplete: null,
};})(jQuery);
;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; }}",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('Play');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:' ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'{content}
',custom_markup:"",social_tools:''},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapInner('').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false;
(function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e"+d+"{#modernizr{height:3px}}"+"").appendTo("head"),f=b('').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",t&&clearTimeout(t),t=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var u=["width","height"],v=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=u.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;fg?1:f0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),v.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;id&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;id&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var w=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){w("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){w("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap(''),o.viewport=r.parent(),o.loader=t(''),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t(''),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e0)if(o.viewport.width()o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t(''),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t(''+o.settings.nextText+""),o.controls.prev=t(''+o.settings.prevText+""),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t(''),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('"),o.controls.stop=t('"),o.controls.autoEl=t(''),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append(''+e+"
")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
;(function($, undefined){
var ver='2.9998';
if($.support==undefined){
$.support={
opacity: !($.browser.msie)
};}
function debug(s){
$.fn.cycle.debug&&log(s);
}
function log(){
window.console&&console.log&&console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
}
$.expr[':'].paused=function(el){
return el.cyclePause;
}
$.fn.cycle=function(options, arg2){
var o={ s: this.selector, c: this.context };
if(this.length===0&&options!='stop'){
if(!$.isReady&&o.s){
log('DOM not ready, queuing slideshow');
$(function(){
$(o.s,o.c).cycle(options,arg2);
});
return this;
}
log('terminating; zero elements found by selector' + ($.isReady ? '':' (DOM not ready)'));
return this;
}
return this.each(function(){
var opts=handleArguments(this, options, arg2);
if(opts===false)
return;
opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;
if(this.cycleTimeout)
clearTimeout(this.cycleTimeout);
this.cycleTimeout=this.cyclePause=0;
var $cont=$(this);
var $slides=opts.slideExpr ? $(opts.slideExpr, this):$cont.children();
var els=$slides.get();
var opts2=buildOptions($cont, $slides, els, opts, o);
if(opts2===false)
return;
if(els.length < 2){
log('terminating; too few slides: ' + els.length);
return;
}
var startTime=opts2.continuous ? 10:getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards);
if(startTime){
startTime +=(opts2.delay||0);
if(startTime < 10)
startTime=10;
debug('first timeout: ' + startTime);
this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts.backwards)}, startTime);
}});
};
function triggerPause(cont, byHover, onPager){
var opts=$(cont).data('cycle.opts');
var paused = !!cont.cyclePause;
if(paused&&opts.paused)
opts.paused(cont, opts, byHover, onPager);
else if(!paused&&opts.resumed)
opts.resumed(cont, opts, byHover, onPager);
}
function handleArguments(cont, options, arg2){
if(cont.cycleStop==undefined)
cont.cycleStop=0;
if(options===undefined||options===null)
options={};
if(options.constructor==String){
switch(options){
case 'destroy':
case 'stop':
var opts=$(cont).data('cycle.opts');
if(!opts)
return false;
cont.cycleStop++;
if(cont.cycleTimeout)
clearTimeout(cont.cycleTimeout);
cont.cycleTimeout=0;
opts.elements&&$(opts.elements).stop();
$(cont).removeData('cycle.opts');
if(options=='destroy')
destroy(opts);
return false;
case 'toggle':
cont.cyclePause=(cont.cyclePause===1) ? 0:1;
checkInstantResume(cont.cyclePause, arg2, cont);
triggerPause(cont);
return false;
case 'pause':
cont.cyclePause=1;
triggerPause(cont);
return false;
case 'resume':
cont.cyclePause=0;
checkInstantResume(false, arg2, cont);
triggerPause(cont);
return false;
case 'prev':
case 'next':
var opts=$(cont).data('cycle.opts');
if(!opts){
log('options not found, "prev/next" ignored');
return false;
}
$.fn.cycle[options](opts);
return false;
default:
options={ fx: options };};
return options;
}
else if(options.constructor==Number){
var num=options;
options=$(cont).data('cycle.opts');
if(!options){
log('options not found, can not advance slide');
return false;
}
if(num < 0||num >=options.elements.length){
log('invalid slide index: ' + num);
return false;
}
options.nextSlide=num;
if(cont.cycleTimeout){
clearTimeout(cont.cycleTimeout);
cont.cycleTimeout=0;
}
if(typeof arg2=='string')
options.oneTimeFx=arg2;
go(options.elements, options, 1, num >=options.currSlide);
return false;
}
return options;
function checkInstantResume(isPaused, arg2, cont){
if(!isPaused&&arg2===true){
var options=$(cont).data('cycle.opts');
if(!options){
log('options not found, can not resume');
return false;
}
if(cont.cycleTimeout){
clearTimeout(cont.cycleTimeout);
cont.cycleTimeout=0;
}
go(options.elements, options, 1, !options.backwards);
}}
};
function removeFilter(el, opts){
if(!$.support.opacity&&opts.cleartype&&el.style.filter){
try { el.style.removeAttribute('filter'); }
catch(smother){}}
};
function destroy(opts){
if(opts.next)
$(opts.next).unbind(opts.prevNextEvent);
if(opts.prev)
$(opts.prev).unbind(opts.prevNextEvent);
if(opts.pager||opts.pagerAnchorBuilder)
$.each(opts.pagerAnchors||[], function(){
this.unbind().remove();
});
opts.pagerAnchors=null;
if(opts.destroy)
opts.destroy(opts);
};
function buildOptions($cont, $slides, els, options, o){
var startingSlideSpecified;
var opts=$.extend({}, $.fn.cycle.defaults, options||{}, $.metadata ? $cont.metadata():$.meta ? $cont.data():{});
var meta=$.isFunction($cont.data) ? $cont.data(opts.metaAttr):null;
if(meta)
opts=$.extend(opts, meta);
if(opts.autostop)
opts.countdown=opts.autostopCount||els.length;
var cont=$cont[0];
$cont.data('cycle.opts', opts);
opts.$cont=$cont;
opts.stopCount=cont.cycleStop;
opts.elements=els;
opts.before=opts.before ? [opts.before]:[];
opts.after=opts.after ? [opts.after]:[];
if(!$.support.opacity&&opts.cleartype)
opts.after.push(function(){ removeFilter(this, opts); });
if(opts.continuous)
opts.after.push(function(){ go(els,opts,0,!opts.backwards); });
saveOriginalOpts(opts);
if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg)
clearTypeFix($slides);
if($cont.css('position')=='static')
$cont.css('position', 'relative');
if(opts.width)
$cont.width(opts.width);
if(opts.height&&opts.height!='auto')
$cont.height(opts.height);
if(opts.startingSlide!=undefined){
opts.startingSlide=parseInt(opts.startingSlide,10);
if(opts.startingSlide >=els.length||opts.startSlide < 0)
opts.startingSlide=0;
else
startingSlideSpecified=true;
}
else if(opts.backwards)
opts.startingSlide=els.length - 1;
else
opts.startingSlide=0;
if(opts.random){
opts.randomMap=[];
for (var i=0; i < els.length; i++)
opts.randomMap.push(i);
opts.randomMap.sort(function(a,b){return Math.random() - 0.5;});
if(startingSlideSpecified){
for(var cnt=0; cnt < els.length; cnt++){
if(opts.startingSlide==opts.randomMap[cnt]){
opts.randomIndex=cnt;
}}
}else{
opts.randomIndex=1;
opts.startingSlide=opts.randomMap[1];
}}
else if(opts.startingSlide >=els.length)
opts.startingSlide=0;
opts.currSlide=opts.startingSlide||0;
var first=opts.startingSlide;
$slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i){
var z;
if(opts.backwards)
z=first ? i <=first ? els.length + (i-first):first-i:els.length-i;
else
z=first ? i >=first ? els.length - (i-first):first-i:els.length-i;
$(this).css('z-index', z)
});
$(els[first]).css('opacity',1).show();
removeFilter(els[first], opts);
if(opts.fit){
if(!opts.aspect){
if(opts.width)
$slides.width(opts.width);
if(opts.height&&opts.height!='auto')
$slides.height(opts.height);
}else{
$slides.each(function(){
var $slide=$(this);
var ratio=(opts.aspect===true) ? $slide.width()/$slide.height():opts.aspect;
if(opts.width&&$slide.width()!=opts.width){
$slide.width(opts.width);
$slide.height(opts.width / ratio);
}
if(opts.height&&$slide.height() < opts.height){
$slide.height(opts.height);
$slide.width(opts.height * ratio);
}});
}}
if(opts.center&&((!opts.fit)||opts.aspect)){
$slides.each(function(){
var $slide=$(this);
$slide.css({
"margin-left": opts.width ?
((opts.width - $slide.width()) / 2) + "px" :
0,
"margin-top": opts.height ?
((opts.height - $slide.height()) / 2) + "px" :
0
});
});
}
if(opts.center&&!opts.fit&&!opts.slideResize){
$slides.each(function(){
var $slide=$(this);
$slide.css({
"margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px":0,
"margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px":0
});
});
}
var reshape=opts.containerResize&&!$cont.innerHeight();
if(reshape){
var maxw=0, maxh=0;
for(var j=0; j < els.length; j++){
var $e=$(els[j]), e=$e[0], w=$e.outerWidth(), h=$e.outerHeight();
if(!w) w=e.offsetWidth||e.width||$e.attr('width');
if(!h) h=e.offsetHeight||e.height||$e.attr('height');
maxw=w > maxw ? w:maxw;
maxh=h > maxh ? h:maxh;
}
if(maxw > 0&&maxh > 0)
$cont.css({width:maxw+'px',height:maxh+'px'});
}
var pauseFlag=false;
if(opts.pause)
$cont.hover(function(){
pauseFlag=true;
this.cyclePause++;
triggerPause(cont, true);
},
function(){
pauseFlag&&this.cyclePause--;
triggerPause(cont, true);
}
);
if(supportMultiTransitions(opts)===false)
return false;
var requeue=false;
options.requeueAttempts=options.requeueAttempts||0;
$slides.each(function(){
var $el=$(this);
this.cycleH=(opts.fit&&opts.height) ? opts.height:($el.height()||this.offsetHeight||this.height||$el.attr('height')||0);
this.cycleW=(opts.fit&&opts.width) ? opts.width:($el.width()||this.offsetWidth||this.width||$el.attr('width')||0);
if($el.is('img')){
var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);
var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);
var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);
var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);
if(loadingIE||loadingFF||loadingOp||loadingOther){
if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts < 100){
log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
setTimeout(function(){$(o.s,o.c).cycle(options)}, opts.requeueTimeout);
requeue=true;
return false;
}else{
log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
}}
}
return true;
});
if(requeue)
return false;
opts.cssBefore=opts.cssBefore||{};
opts.cssAfter=opts.cssAfter||{};
opts.cssFirst=opts.cssFirst||{};
opts.animIn=opts.animIn||{};
opts.animOut=opts.animOut||{};
$slides.not(':eq('+first+')').css(opts.cssBefore);
$($slides[first]).css(opts.cssFirst);
if(opts.timeout){
opts.timeout=parseInt(opts.timeout,10);
if(opts.speed.constructor==String)
opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed,10);
if(!opts.sync)
opts.speed=opts.speed / 2;
var buffer=opts.fx=='none' ? 0:opts.fx=='shuffle' ? 500:250;
while((opts.timeout - opts.speed) < buffer)
opts.timeout +=opts.speed;
}
if(opts.easing)
opts.easeIn=opts.easeOut=opts.easing;
if(!opts.speedIn)
opts.speedIn=opts.speed;
if(!opts.speedOut)
opts.speedOut=opts.speed;
opts.slideCount=els.length;
opts.currSlide=opts.lastSlide=first;
if(opts.random){
if(++opts.randomIndex==els.length)
opts.randomIndex=0;
opts.nextSlide=opts.randomMap[opts.randomIndex];
}
else if(opts.backwards)
opts.nextSlide=opts.startingSlide==0 ? (els.length-1):opts.startingSlide-1;
else
opts.nextSlide=opts.startingSlide >=(els.length-1) ? 0:opts.startingSlide+1;
if(!opts.multiFx){
var init=$.fn.cycle.transitions[opts.fx];
if($.isFunction(init))
init($cont, $slides, opts);
else if(opts.fx!='custom'&&!opts.multiFx){
log('unknown transition: ' + opts.fx,'; slideshow terminating');
return false;
}}
var e0=$slides[first];
if(!opts.skipInitializationCallbacks){
if(opts.before.length)
opts.before[0].apply(e0, [e0, e0, opts, true]);
if(opts.after.length)
opts.after[0].apply(e0, [e0, e0, opts, true]);
}
if(opts.next)
$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1)});
if(opts.prev)
$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0)});
if(opts.pager||opts.pagerAnchorBuilder)
buildPager(els,opts);
exposeAddSlide(opts, els);
return opts;
};
function saveOriginalOpts(opts){
opts.original={ before: [], after: [] };
opts.original.cssBefore=$.extend({}, opts.cssBefore);
opts.original.cssAfter=$.extend({}, opts.cssAfter);
opts.original.animIn=$.extend({}, opts.animIn);
opts.original.animOut=$.extend({}, opts.animOut);
$.each(opts.before, function(){ opts.original.before.push(this); });
$.each(opts.after, function(){ opts.original.after.push(this); });
};
function supportMultiTransitions(opts){
var i, tx, txs=$.fn.cycle.transitions;
if(opts.fx.indexOf(',') > 0){
opts.multiFx=true;
opts.fxs=opts.fx.replace(/\s*/g,'').split(',');
for (i=0; i < opts.fxs.length; i++){
var fx=opts.fxs[i];
tx=txs[fx];
if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){
log('discarding unknown transition: ',fx);
opts.fxs.splice(i,1);
i--;
}}
if(!opts.fxs.length){
log('No valid transitions named; slideshow terminating.');
return false;
}}
else if(opts.fx=='all'){
opts.multiFx=true;
opts.fxs=[];
for (p in txs){
tx=txs[p];
if(txs.hasOwnProperty(p)&&$.isFunction(tx))
opts.fxs.push(p);
}}
if(opts.multiFx&&opts.randomizeEffects){
var r1=Math.floor(Math.random() * 20) + 30;
for (i=0; i < r1; i++){
var r2=Math.floor(Math.random() * opts.fxs.length);
opts.fxs.push(opts.fxs.splice(r2,1)[0]);
}
debug('randomized fx sequence: ',opts.fxs);
}
return true;
};
function exposeAddSlide(opts, els){
opts.addSlide=function(newSlide, prepend){
var $s=$(newSlide), s=$s[0];
if(!opts.autostopCount)
opts.countdown++;
els[prepend?'unshift':'push'](s);
if(opts.els)
opts.els[prepend?'unshift':'push'](s);
opts.slideCount=els.length;
if(opts.random){
opts.randomMap.push(opts.slideCount-1);
opts.randomMap.sort(function(a,b){return Math.random() - 0.5;});
}
$s.css('position','absolute');
$s[prepend?'prependTo':'appendTo'](opts.$cont);
if(prepend){
opts.currSlide++;
opts.nextSlide++;
}
if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg)
clearTypeFix($s);
if(opts.fit&&opts.width)
$s.width(opts.width);
if(opts.fit&&opts.height&&opts.height!='auto')
$s.height(opts.height);
s.cycleH=(opts.fit&&opts.height) ? opts.height:$s.height();
s.cycleW=(opts.fit&&opts.width) ? opts.width:$s.width();
$s.css(opts.cssBefore);
if(opts.pager||opts.pagerAnchorBuilder)
$.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
if($.isFunction(opts.onAddSlide))
opts.onAddSlide($s);
else
$s.hide();
};}
$.fn.cycle.resetState=function(opts, fx){
fx=fx||opts.fx;
opts.before=[]; opts.after=[];
opts.cssBefore=$.extend({}, opts.original.cssBefore);
opts.cssAfter=$.extend({}, opts.original.cssAfter);
opts.animIn=$.extend({}, opts.original.animIn);
opts.animOut=$.extend({}, opts.original.animOut);
opts.fxFn=null;
$.each(opts.original.before, function(){ opts.before.push(this); });
$.each(opts.original.after, function(){ opts.after.push(this); });
var init=$.fn.cycle.transitions[fx];
if($.isFunction(init))
init(opts.$cont, $(opts.elements), opts);
};
function go(els, opts, manual, fwd){
if(manual&&opts.busy&&opts.manualTrump){
debug('manualTrump in go(), stopping active transition');
$(els).stop(true,true);
opts.busy=0;
}
if(opts.busy){
debug('transition active, ignoring new tx request');
return;
}
var p=opts.$cont[0], curr=els[opts.currSlide], next=els[opts.nextSlide];
if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual)
return;
if(!manual&&!p.cyclePause&&!opts.bounce &&
((opts.autostop&&(--opts.countdown <=0)) ||
(opts.nowrap&&!opts.random&&opts.nextSlide < opts.currSlide))){
if(opts.end)
opts.end(opts);
return;
}
var changed=false;
if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){
changed=true;
var fx=opts.fx;
curr.cycleH=curr.cycleH||$(curr).height();
curr.cycleW=curr.cycleW||$(curr).width();
next.cycleH=next.cycleH||$(next).height();
next.cycleW=next.cycleW||$(next).width();
if(opts.multiFx){
if(fwd&&(opts.lastFx==undefined||++opts.lastFx >=opts.fxs.length))
opts.lastFx=0;
else if(!fwd&&(opts.lastFx==undefined||--opts.lastFx < 0))
opts.lastFx=opts.fxs.length - 1;
fx=opts.fxs[opts.lastFx];
}
if(opts.oneTimeFx){
fx=opts.oneTimeFx;
opts.oneTimeFx=null;
}
$.fn.cycle.resetState(opts, fx);
if(opts.before.length)
$.each(opts.before, function(i,o){
if(p.cycleStop!=opts.stopCount) return;
o.apply(next, [curr, next, opts, fwd]);
});
var after=function(){
opts.busy=0;
$.each(opts.after, function(i,o){
if(p.cycleStop!=opts.stopCount) return;
o.apply(next, [curr, next, opts, fwd]);
});
if(!p.cycleStop){
queueNext();
}};
debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide);
opts.busy=1;
if(opts.fxFn)
opts.fxFn(curr, next, opts, after, fwd, manual&&opts.fastOnEvent);
else if($.isFunction($.fn.cycle[opts.fx]))
$.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual&&opts.fastOnEvent);
else
$.fn.cycle.custom(curr, next, opts, after, fwd, manual&&opts.fastOnEvent);
}else{
queueNext();
}
if(changed||opts.nextSlide==opts.currSlide){
opts.lastSlide=opts.currSlide;
if(opts.random){
opts.currSlide=opts.nextSlide;
if(++opts.randomIndex==els.length){
opts.randomIndex=0;
opts.randomMap.sort(function(a,b){return Math.random() - 0.5;});
}
opts.nextSlide=opts.randomMap[opts.randomIndex];
if(opts.nextSlide==opts.currSlide)
opts.nextSlide=(opts.currSlide==opts.slideCount - 1) ? 0:opts.currSlide + 1;
}
else if(opts.backwards){
var roll=(opts.nextSlide - 1) < 0;
if(roll&&opts.bounce){
opts.backwards = !opts.backwards;
opts.nextSlide=1;
opts.currSlide=0;
}else{
opts.nextSlide=roll ? (els.length-1):opts.nextSlide-1;
opts.currSlide=roll ? 0:opts.nextSlide+1;
}}else{
var roll=(opts.nextSlide + 1)==els.length;
if(roll&&opts.bounce){
opts.backwards = !opts.backwards;
opts.nextSlide=els.length-2;
opts.currSlide=els.length-1;
}else{
opts.nextSlide=roll ? 0:opts.nextSlide+1;
opts.currSlide=roll ? els.length-1:opts.nextSlide-1;
}}
}
if(changed&&opts.pager)
opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
function queueNext(){
var ms=0, timeout=opts.timeout;
if(opts.timeout&&!opts.continuous){
ms=getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd);
if(opts.fx=='shuffle')
ms -=opts.speedOut;
}
else if(opts.continuous&&p.cyclePause)
ms=10;
if(ms > 0)
p.cycleTimeout=setTimeout(function(){ go(els, opts, 0, !opts.backwards) }, ms);
}};
$.fn.cycle.updateActivePagerLink=function(pager, currSlide, clsName){
$(pager).each(function(){
$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);
});
};
function getTimeout(curr, next, opts, fwd){
if(opts.timeoutFn){
var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);
while (opts.fx!='none'&&(t - opts.speed) < 250)
t +=opts.speed;
debug('calculated timeout: ' + t + '; speed: ' + opts.speed);
if(t!==false)
return t;
}
return opts.timeout;
};
$.fn.cycle.next=function(opts){ advance(opts,1); };
$.fn.cycle.prev=function(opts){ advance(opts,0);};
function advance(opts, moveForward){
var val=moveForward ? 1:-1;
var els=opts.elements;
var p=opts.$cont[0], timeout=p.cycleTimeout;
if(timeout){
clearTimeout(timeout);
p.cycleTimeout=0;
}
if(opts.random&&val < 0){
opts.randomIndex--;
if(--opts.randomIndex==-2)
opts.randomIndex=els.length-2;
else if(opts.randomIndex==-1)
opts.randomIndex=els.length-1;
opts.nextSlide=opts.randomMap[opts.randomIndex];
}
else if(opts.random){
opts.nextSlide=opts.randomMap[opts.randomIndex];
}else{
opts.nextSlide=opts.currSlide + val;
if(opts.nextSlide < 0){
if(opts.nowrap) return false;
opts.nextSlide=els.length - 1;
}
else if(opts.nextSlide >=els.length){
if(opts.nowrap) return false;
opts.nextSlide=0;
}}
var cb=opts.onPrevNextEvent||opts.prevNextClick;
if($.isFunction(cb))
cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
go(els, opts, 1, moveForward);
return false;
};
function buildPager(els, opts){
var $p=$(opts.pager);
$.each(els, function(i,o){
$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
});
opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
};
$.fn.cycle.createPagerAnchor=function(i, el, $p, els, opts){
var a;
if($.isFunction(opts.pagerAnchorBuilder)){
a=opts.pagerAnchorBuilder(i,el);
debug('pagerAnchorBuilder('+i+', el) returned: ' + a);
}
else
a=''+(i+1)+'';
if(!a)
return;
var $a=$(a);
if($a.parents('body').length===0){
var arr=[];
if($p.length > 1){
$p.each(function(){
var $clone=$a.clone(true);
$(this).append($clone);
arr.push($clone[0]);
});
$a=$(arr);
}else{
$a.appendTo($p);
}}
opts.pagerAnchors=opts.pagerAnchors||[];
opts.pagerAnchors.push($a);
var pagerFn=function(e){
e.preventDefault();
opts.nextSlide=i;
var p=opts.$cont[0], timeout=p.cycleTimeout;
if(timeout){
clearTimeout(timeout);
p.cycleTimeout=0;
}
var cb=opts.onPagerEvent||opts.pagerClick;
if($.isFunction(cb))
cb(opts.nextSlide, els[opts.nextSlide]);
go(els,opts,1,opts.currSlide < i);
}
if(/mouseenter|mouseover/i.test(opts.pagerEvent)){
$a.hover(pagerFn, function(){});
}else{
$a.bind(opts.pagerEvent, pagerFn);
}
if(! /^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble)
$a.bind('click.cycle', function(){return false;});
var cont=opts.$cont[0];
var pauseFlag=false;
if(opts.pauseOnPagerHover){
$a.hover(function(){
pauseFlag=true;
cont.cyclePause++;
triggerPause(cont,true,true);
}, function(){
pauseFlag&&cont.cyclePause--;
triggerPause(cont,true,true);
}
);
}};
$.fn.cycle.hopsFromLast=function(opts, fwd){
var hops, l=opts.lastSlide, c=opts.currSlide;
if(fwd)
hops=c > l ? c - l:opts.slideCount - l;
else
hops=c < l ? l - c:l + opts.slideCount - c;
return hops;
};
function clearTypeFix($slides){
debug('applying clearType background-color hack');
function hex(s){
s=parseInt(s,10).toString(16);
return s.length < 2 ? '0'+s:s;
};
function getBg(e){
for(; e&&e.nodeName.toLowerCase()!='html'; e=e.parentNode){
var v=$.css(e,'background-color');
if(v&&v.indexOf('rgb') >=0){
var rgb=v.match(/\d+/g);
return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
}
if(v&&v!='transparent')
return v;
}
return '#ffffff';
};
$slides.each(function(){ $(this).css('background-color', getBg(this)); });
};
$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){
$(opts.elements).not(curr).hide();
if(typeof opts.cssBefore.opacity=='undefined')
opts.cssBefore.opacity=1;
opts.cssBefore.display='block';
if(opts.slideResize&&w!==false&&next.cycleW > 0)
opts.cssBefore.width=next.cycleW;
if(opts.slideResize&&h!==false&&next.cycleH > 0)
opts.cssBefore.height=next.cycleH;
opts.cssAfter=opts.cssAfter||{};
opts.cssAfter.display='none';
$(curr).css('zIndex',opts.slideCount + (rev===true ? 1:0));
$(next).css('zIndex',opts.slideCount + (rev===true ? 0:1));
};
$.fn.cycle.custom=function(curr, next, opts, cb, fwd, speedOverride){
var $l=$(curr), $n=$(next);
var speedIn=opts.speedIn, speedOut=opts.speedOut, easeIn=opts.easeIn, easeOut=opts.easeOut;
$n.css(opts.cssBefore);
if(speedOverride){
if(typeof speedOverride=='number')
speedIn=speedOut=speedOverride;
else
speedIn=speedOut=1;
easeIn=easeOut=null;
}
var fn=function(){
$n.animate(opts.animIn, speedIn, easeIn, function(){
cb();
});
};
$l.animate(opts.animOut, speedOut, easeOut, function(){
$l.css(opts.cssAfter);
if(!opts.sync)
fn();
});
if(opts.sync) fn();
};
$.fn.cycle.transitions={
fade: function($cont, $slides, opts){
$slides.not(':eq('+opts.currSlide+')').css('opacity',0);
opts.before.push(function(curr,next,opts){
$.fn.cycle.commonReset(curr,next,opts);
opts.cssBefore.opacity=0;
});
opts.animIn={ opacity: 1 };
opts.animOut={ opacity: 0 };
opts.cssBefore={ top: 0, left: 0 };}};
$.fn.cycle.ver=function(){ return ver; };
$.fn.cycle.defaults={
activePagerClass: 'activeSlide',
after: null,
allowPagerClickBubble: false,
animIn: null,
animOut: null,
aspect: false,
autostop: 0,
autostopCount: 0,
backwards: false,
before: null,
center: null,
cleartype: !$.support.opacity,
cleartypeNoBg: false,
containerResize: 1,
continuous: 0,
cssAfter: null,
cssBefore: null,
delay: 0,
easeIn: null,
easeOut: null,
easing: null,
end: null,
fastOnEvent: 0,
fit: 0,
fx: 'fade',
fxFn: null,
height: 'auto',
manualTrump: true,
metaAttr: 'cycle',
next: null,
nowrap: 0,
onPagerEvent: null,
onPrevNextEvent: null,
pager: null,
pagerAnchorBuilder: null,
pagerEvent: 'click.cycle',
pause: 0,
pauseOnPagerHover: 0,
prev: null,
prevNextEvent:'click.cycle',
random: 0,
randomizeEffects: 1,
requeueOnImageNotLoaded: true,
requeueTimeout: 250,
rev: 0,
shuffle: null,
skipInitializationCallbacks: false,
slideExpr: null,
slideResize: 1,
speed: 1000,
speedIn: null,
speedOut: null,
startingSlide: 0,
sync: 1,
timeout: 4000,
timeoutFn: null,
updateActivePagerLink: null,
width: null
};})(jQuery);
(function($){
$.fn.cycle.transitions.none=function($cont, $slides, opts){
opts.fxFn=function(curr,next,opts,after){
$(next).show();
$(curr).hide();
after();
};};
$.fn.cycle.transitions.fadeout=function($cont, $slides, opts){
$slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 });
opts.before.push(function(curr,next,opts,w,h,rev){
$(curr).css('zIndex',opts.slideCount + (!rev===true ? 1:0));
$(next).css('zIndex',opts.slideCount + (!rev===true ? 0:1));
});
opts.animIn.opacity=1;
opts.animOut.opacity=0;
opts.cssBefore.opacity=1;
opts.cssBefore.display='block';
opts.cssAfter.zIndex=0;
};
$.fn.cycle.transitions.scrollUp=function($cont, $slides, opts){
$cont.css('overflow','hidden');
opts.before.push($.fn.cycle.commonReset);
var h=$cont.height();
opts.cssBefore.top=h;
opts.cssBefore.left=0;
opts.cssFirst.top=0;
opts.animIn.top=0;
opts.animOut.top=-h;
};
$.fn.cycle.transitions.scrollDown=function($cont, $slides, opts){
$cont.css('overflow','hidden');
opts.before.push($.fn.cycle.commonReset);
var h=$cont.height();
opts.cssFirst.top=0;
opts.cssBefore.top=-h;
opts.cssBefore.left=0;
opts.animIn.top=0;
opts.animOut.top=h;
};
$.fn.cycle.transitions.scrollLeft=function($cont, $slides, opts){
$cont.css('overflow','hidden');
opts.before.push($.fn.cycle.commonReset);
var w=$cont.width();
opts.cssFirst.left=0;
opts.cssBefore.left=w;
opts.cssBefore.top=0;
opts.animIn.left=0;
opts.animOut.left=0-w;
};
$.fn.cycle.transitions.scrollRight=function($cont, $slides, opts){
$cont.css('overflow','hidden');
opts.before.push($.fn.cycle.commonReset);
var w=$cont.width();
opts.cssFirst.left=0;
opts.cssBefore.left=-w;
opts.cssBefore.top=0;
opts.animIn.left=0;
opts.animOut.left=w;
};
$.fn.cycle.transitions.scrollHorz=function($cont, $slides, opts){
$cont.css('overflow','hidden').width();
opts.before.push(function(curr, next, opts, fwd){
if(opts.rev)
fwd = !fwd;
$.fn.cycle.commonReset(curr,next,opts);
opts.cssBefore.left=fwd ? (next.cycleW-1):(1-next.cycleW);
opts.animOut.left=fwd ? -curr.cycleW:curr.cycleW;
});
opts.cssFirst.left=0;
opts.cssBefore.top=0;
opts.animIn.left=0;
opts.animOut.top=0;
};
$.fn.cycle.transitions.scrollVert=function($cont, $slides, opts){
$cont.css('overflow','hidden');
opts.before.push(function(curr, next, opts, fwd){
if(opts.rev)
fwd = !fwd;
$.fn.cycle.commonReset(curr,next,opts);
opts.cssBefore.top=fwd ? (1-next.cycleH):(next.cycleH-1);
opts.animOut.top=fwd ? curr.cycleH:-curr.cycleH;
});
opts.cssFirst.top=0;
opts.cssBefore.left=0;
opts.animIn.top=0;
opts.animOut.left=0;
};
$.fn.cycle.transitions.slideX=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$(opts.elements).not(curr).hide();
$.fn.cycle.commonReset(curr,next,opts,false,true);
opts.animIn.width=next.cycleW;
});
opts.cssBefore.left=0;
opts.cssBefore.top=0;
opts.cssBefore.width=0;
opts.animIn.width='show';
opts.animOut.width=0;
};
$.fn.cycle.transitions.slideY=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$(opts.elements).not(curr).hide();
$.fn.cycle.commonReset(curr,next,opts,true,false);
opts.animIn.height=next.cycleH;
});
opts.cssBefore.left=0;
opts.cssBefore.top=0;
opts.cssBefore.height=0;
opts.animIn.height='show';
opts.animOut.height=0;
};
$.fn.cycle.transitions.shuffle=function($cont, $slides, opts){
var i, w=$cont.css('overflow', 'visible').width();
$slides.css({left: 0, top: 0});
opts.before.push(function(curr,next,opts){
$.fn.cycle.commonReset(curr,next,opts,true,true,true);
});
if(!opts.speedAdjusted){
opts.speed=opts.speed / 2;
opts.speedAdjusted=true;
}
opts.random=0;
opts.shuffle=opts.shuffle||{left:-w, top:15};
opts.els=[];
for (i=0; i < $slides.length; i++)
opts.els.push($slides[i]);
for (i=0; i < opts.currSlide; i++)
opts.els.push(opts.els.shift());
opts.fxFn=function(curr, next, opts, cb, fwd){
if(opts.rev)
fwd = !fwd;
var $el=fwd ? $(curr):$(next);
$(next).css(opts.cssBefore);
var count=opts.slideCount;
$el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function(){
var hops=$.fn.cycle.hopsFromLast(opts, fwd);
for (var k=0; k < hops; k++)
fwd ? opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());
if(fwd){
for (var i=0, len=opts.els.length; i < len; i++)
$(opts.els[i]).css('z-index', len-i+count);
}else{
var z=$(curr).css('z-index');
$el.css('z-index', parseInt(z,10)+1+count);
}
$el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function(){
$(fwd ? this:curr).hide();
if(cb) cb();
});
});
};
$.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
};
$.fn.cycle.transitions.turnUp=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,true,false);
opts.cssBefore.top=next.cycleH;
opts.animIn.height=next.cycleH;
opts.animOut.width=next.cycleW;
});
opts.cssFirst.top=0;
opts.cssBefore.left=0;
opts.cssBefore.height=0;
opts.animIn.top=0;
opts.animOut.height=0;
};
$.fn.cycle.transitions.turnDown=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,true,false);
opts.animIn.height=next.cycleH;
opts.animOut.top=curr.cycleH;
});
opts.cssFirst.top=0;
opts.cssBefore.left=0;
opts.cssBefore.top=0;
opts.cssBefore.height=0;
opts.animOut.height=0;
};
$.fn.cycle.transitions.turnLeft=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,false,true);
opts.cssBefore.left=next.cycleW;
opts.animIn.width=next.cycleW;
});
opts.cssBefore.top=0;
opts.cssBefore.width=0;
opts.animIn.left=0;
opts.animOut.width=0;
};
$.fn.cycle.transitions.turnRight=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,false,true);
opts.animIn.width=next.cycleW;
opts.animOut.left=curr.cycleW;
});
$.extend(opts.cssBefore, { top: 0, left: 0, width: 0 });
opts.animIn.left=0;
opts.animOut.width=0;
};
$.fn.cycle.transitions.zoom=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,false,false,true);
opts.cssBefore.top=next.cycleH/2;
opts.cssBefore.left=next.cycleW/2;
$.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
$.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 });
});
opts.cssFirst.top=0;
opts.cssFirst.left=0;
opts.cssBefore.width=0;
opts.cssBefore.height=0;
};
$.fn.cycle.transitions.fadeZoom=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,false,false);
opts.cssBefore.left=next.cycleW/2;
opts.cssBefore.top=next.cycleH/2;
$.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH });
});
opts.cssBefore.width=0;
opts.cssBefore.height=0;
opts.animOut.opacity=0;
};
$.fn.cycle.transitions.blindX=function($cont, $slides, opts){
var w=$cont.css('overflow','hidden').width();
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts);
opts.animIn.width=next.cycleW;
opts.animOut.left=curr.cycleW;
});
opts.cssBefore.left=w;
opts.cssBefore.top=0;
opts.animIn.left=0;
opts.animOut.left=w;
};
$.fn.cycle.transitions.blindY=function($cont, $slides, opts){
var h=$cont.css('overflow','hidden').height();
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts);
opts.animIn.height=next.cycleH;
opts.animOut.top=curr.cycleH;
});
opts.cssBefore.top=h;
opts.cssBefore.left=0;
opts.animIn.top=0;
opts.animOut.top=h;
};
$.fn.cycle.transitions.blindZ=function($cont, $slides, opts){
var h=$cont.css('overflow','hidden').height();
var w=$cont.width();
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts);
opts.animIn.height=next.cycleH;
opts.animOut.top=curr.cycleH;
});
opts.cssBefore.top=h;
opts.cssBefore.left=w;
opts.animIn.top=0;
opts.animIn.left=0;
opts.animOut.top=h;
opts.animOut.left=w;
};
$.fn.cycle.transitions.growX=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,false,true);
opts.cssBefore.left=this.cycleW/2;
opts.animIn.left=0;
opts.animIn.width=this.cycleW;
opts.animOut.left=0;
});
opts.cssBefore.top=0;
opts.cssBefore.width=0;
};
$.fn.cycle.transitions.growY=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,true,false);
opts.cssBefore.top=this.cycleH/2;
opts.animIn.top=0;
opts.animIn.height=this.cycleH;
opts.animOut.top=0;
});
opts.cssBefore.height=0;
opts.cssBefore.left=0;
};
$.fn.cycle.transitions.curtainX=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,false,true,true);
opts.cssBefore.left=next.cycleW/2;
opts.animIn.left=0;
opts.animIn.width=this.cycleW;
opts.animOut.left=curr.cycleW/2;
opts.animOut.width=0;
});
opts.cssBefore.top=0;
opts.cssBefore.width=0;
};
$.fn.cycle.transitions.curtainY=function($cont, $slides, opts){
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,true,false,true);
opts.cssBefore.top=next.cycleH/2;
opts.animIn.top=0;
opts.animIn.height=next.cycleH;
opts.animOut.top=curr.cycleH/2;
opts.animOut.height=0;
});
opts.cssBefore.height=0;
opts.cssBefore.left=0;
};
$.fn.cycle.transitions.cover=function($cont, $slides, opts){
var d=opts.direction||'left';
var w=$cont.css('overflow','hidden').width();
var h=$cont.height();
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts);
if(d=='right')
opts.cssBefore.left=-w;
else if(d=='up')
opts.cssBefore.top=h;
else if(d=='down')
opts.cssBefore.top=-h;
else
opts.cssBefore.left=w;
});
opts.animIn.left=0;
opts.animIn.top=0;
opts.cssBefore.top=0;
opts.cssBefore.left=0;
};
$.fn.cycle.transitions.uncover=function($cont, $slides, opts){
var d=opts.direction||'left';
var w=$cont.css('overflow','hidden').width();
var h=$cont.height();
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,true,true,true);
if(d=='right')
opts.animOut.left=w;
else if(d=='up')
opts.animOut.top=-h;
else if(d=='down')
opts.animOut.top=h;
else
opts.animOut.left=-w;
});
opts.animIn.left=0;
opts.animIn.top=0;
opts.cssBefore.top=0;
opts.cssBefore.left=0;
};
$.fn.cycle.transitions.toss=function($cont, $slides, opts){
var w=$cont.css('overflow','visible').width();
var h=$cont.height();
opts.before.push(function(curr, next, opts){
$.fn.cycle.commonReset(curr,next,opts,true,true,true);
if(!opts.animOut.left&&!opts.animOut.top)
$.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 });
else
opts.animOut.opacity=0;
});
opts.cssBefore.left=0;
opts.cssBefore.top=0;
opts.animIn.left=0;
};
$.fn.cycle.transitions.wipe=function($cont, $slides, opts){
var w=$cont.css('overflow','hidden').width();
var h=$cont.height();
opts.cssBefore=opts.cssBefore||{};
var clip;
if(opts.clip){
if(/l2r/.test(opts.clip))
clip='rect(0px 0px '+h+'px 0px)';
else if(/r2l/.test(opts.clip))
clip='rect(0px '+w+'px '+h+'px '+w+'px)';
else if(/t2b/.test(opts.clip))
clip='rect(0px '+w+'px 0px 0px)';
else if(/b2t/.test(opts.clip))
clip='rect('+h+'px '+w+'px '+h+'px 0px)';
else if(/zoom/.test(opts.clip)){
var top=parseInt(h/2,10);
var left=parseInt(w/2,10);
clip='rect('+top+'px '+left+'px '+top+'px '+left+'px)';
}}
opts.cssBefore.clip=opts.cssBefore.clip||clip||'rect(0px 0px 0px 0px)';
var d=opts.cssBefore.clip.match(/(\d+)/g);
var t=parseInt(d[0],10), r=parseInt(d[1],10), b=parseInt(d[2],10), l=parseInt(d[3],10);
opts.before.push(function(curr, next, opts){
if(curr==next) return;
var $curr=$(curr), $next=$(next);
$.fn.cycle.commonReset(curr,next,opts,true,true,false);
opts.cssAfter.display='block';
var step=1, count=parseInt((opts.speedIn / 13),10) - 1;
(function f(){
var tt=t ? t - parseInt(step * (t/count),10):0;
var ll=l ? l - parseInt(step * (l/count),10):0;
var bb=b < h ? b + parseInt(step * ((h-b)/count||1),10):h;
var rr=r < w ? r + parseInt(step * ((w-r)/count||1),10):w;
$next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
(step++ <=count) ? setTimeout(f, 13):$curr.css('display', 'none');
})();
});
$.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 });
opts.animIn={ left: 0 };
opts.animOut={ left: 0 };};
})(jQuery);
(function ($){
"use strict";
$.fn.maximage=function (settings, helperSettings){
var config;
if(typeof settings=='object'||settings===undefined) config=$.extend($.fn.maximage.defaults, settings||{});
if(typeof settings=='string') config=$.fn.maximage.defaults;
$.Body=$('body');
$.Window=$(window);
$.Scroll=$('html, body');
$.Events={
RESIZE: 'resize'
};
this.each(function(){
var $self=$(this),
preload_count=0,
imageCache=[];
var Modern={
setup: function(){
if($.Slides.length > 0){
var i,
len=$.Slides.length;
for(i=0; i < len; i++){
var $img=$.Slides[i];
$self.append(''+ $img.content +'
');
}
Modern.preload(0);
Modern.resize();
}},
preload: function(n){
var $img=$('');
$img.load(function(){
if(preload_count==0){
Cycle.setup();
config.onFirstImageLoaded();
}
if(preload_count==($.Slides.length-1)){
config.onImagesLoaded($self);
}else{
preload_count++;
Modern.preload(preload_count);
}});
$img[0].src=$.Slides[n].url;
imageCache.push($img[0]);
},
resize: function(){
$.Window
.bind($.Events.RESIZE,
function(){
$.Scroll.addClass('mc-hide-scrolls');
$.Window
.data('h', Utils.sizes().h)
.data('w', Utils.sizes().w);
$self
.height($.Window.data('h')).width($.Window.data('w'))
.children()
.height($.Window.data('h')).width($.Window.data('w'));
$self.children().each(function(){
this.cycleH=$.Window.data('h');
this.cycleW=$.Window.data('w');
});
$($.Scroll).removeClass('mc-hide-scrolls');
});
}}
var Old={
setup: function(){
var c, t, $div, j, slideLen=$.Slides.length;
if($.BrowserTests.msie&&!config.overrideMSIEStop){
document.execCommand ("Stop", false);
}
$self.html('');
$.Body.addClass('mc-old-browser');
if($.Slides.length > 0){
$.Scroll.addClass('mc-hide-scrolls');
$.Window
.data('h', Utils.sizes().h)
.data('w', Utils.sizes().w);
$('body').append($("").attr("class", "mc-loader").css({'position':'absolute','left':'-9999px'}));
for(j=0; j < slideLen; j++){
if($.Slides[j].content.length==0){
c='';
}else{
c=$.Slides[j].content;
}
$div=$("" + c + "
").attr("class", "mc-image mc-image-n" + j + " " + $.Slides[j].theclass);
$self.append($div);
if($('.mc-image-n' + j).children('img').length==0){
}else{
$('div.mc-loader').append($('.mc-image-n' + j).children('img').first().clone().addClass('not-loaded'));
}}
Old.preload();
Old.windowResize();
}},
preload: function(){
var t=setInterval(function(){
$('.mc-loader').children('img').each(function(i){
var $img=$(this);
if($img.hasClass('not-loaded')){
if($img.height() > 0){
$(this).removeClass('not-loaded');
var $img1=$('div.mc-image-n' + i).children('img').first();
$img1
.data('h', $img.height())
.data('w', $img.width())
.data('ar', ($img.width() / $img.height()));
Old.onceLoaded(i)
}}
});
if($('.not-loaded').length==0){
$('.mc-loader').remove();
clearInterval(t);
}}, 1000);
},
onceLoaded: function(m){
Old.maximage(m);
if(m==0){
$self.css({'visibility':'visible'});
config.onFirstImageLoaded();
}else if(m==$.Slides.length - 1){
Cycle.setup();
$($.Scroll).removeClass('mc-hide-scrolls');
config.onImagesLoaded($self);
if(config.debug){
debug(' - Final Maximage - ');debug($self);
}}
},
maximage: function(p){
$('div.mc-image-n' + p)
.height($.Window.data('h'))
.width($.Window.data('w'))
.children('img')
.first()
.each(function(){
Adjust.maxcover($(this));
});
},
windowResize: function(){
$.Window
.bind($.Events.RESIZE,
function(){
clearTimeout(this.id);
if($('.mc-image').length >=1){
this.id=setTimeout(Old.doneResizing, 200);
}});
},
doneResizing: function(){
$($.Scroll).addClass('mc-hide-scrolls');
$.Window
.data('h', Utils.sizes().h)
.data('w', Utils.sizes().w);
$self.height($.Window.data('h')).width($.Window.data('w'))
$self.find('.mc-image').each(function(n){
Old.maximage(n);
});
var curr_opts=$self.data('cycle.opts');
if(curr_opts!=undefined){
curr_opts.height=$.Window.data('h');
curr_opts.width=$.Window.data('w');
jQuery.each(curr_opts.elements, function(index, item){
item.cycleW=$.Window.data('w');
item.cycleH=$.Window.data('h');
});
}
$($.Scroll).removeClass('mc-hide-scrolls');
}}
var Cycle={
setup: function(){
var h,w;
$self.addClass('mc-cycle');
$.Window
.data('h', Utils.sizes().h)
.data('w', Utils.sizes().w);
jQuery.easing.easeForCSSTransition=function(x, t, b, c, d, s){
return b+c;
};
var cycleOptions=$.extend({
fit:1,
containerResize:0,
height:$.Window.data('h'),
width:$.Window.data('w'),
slideResize: false,
easing: ($.BrowserTests.cssTransitions&&config.cssTransitions ? 'easeForCSSTransition':'swing')
}, config.cycleOptions);
$self.cycle(cycleOptions);
}}
var Adjust={
center: function($item){
if(config.verticalCenter){
$item.css({marginTop:(($item.height() - $.Window.data('h'))/2) * -1})
}
if(config.horizontalCenter){
$item.css({marginLeft:(($item.width() - $.Window.data('w'))/2) * -1});
}},
fill: function($item){
var $storageEl=$item.is('object') ? $item.parent().first():$item;
if(typeof config.backgroundSize=='function'){
config.backgroundSize($item);
}else if(config.backgroundSize=='cover'){
if($.Window.data('w') / $.Window.data('h') < $storageEl.data('ar')){
$item
.height($.Window.data('h'))
.width(($.Window.data('h') * $storageEl.data('ar')).toFixed(0));
}else{
$item
.height(($.Window.data('w') / $storageEl.data('ar')).toFixed(0))
.width($.Window.data('w'));
}}else if(config.backgroundSize=='contain'){
if($.Window.data('w') / $.Window.data('h') < $storageEl.data('ar')){
$item
.height(($.Window.data('w') / $storageEl.data('ar')).toFixed(0))
.width($.Window.data('w'));
}else{
$item
.height($.Window.data('h'))
.width(($.Window.data('h') * $storageEl.data('ar')).toFixed(0));
}}else{
debug('The backgroundSize option was not recognized for older browsers.');
}},
maxcover: function($item){
Adjust.fill($item);
Adjust.center($item);
},
maxcontain: function($item){
Adjust.fill($item);
Adjust.center($item);
}}
var Utils={
browser_tests: function(){
var $div=$('')[0],
vendor=['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
p='transition',
obj={
cssTransitions: false,
cssBackgroundSize:("backgroundSize" in $div.style&&config.cssBackgroundSize),
html5Video: false,
msie: false
};
if(config.cssTransitions){
if(typeof $div.style[p]=='string'){ obj.cssTransitions=true }
p=p.charAt(0).toUpperCase() + p.substr(1);
for(var i=0; i 0){
if($.BrowserTests.cssBackgroundSize){
$(this).find('img').first().remove();
}
obj.content=$(this).html();
}
$img[0].src="";
if($.BrowserTests.cssBackgroundSize){
$(this).remove();
}
arr.push(obj);
});
if(config.debug){
debug(' - Slide Object - ');debug(arr);
}
return arr;
},
msie: function(){
var undef,
v=3,
div=document.createElement('div'),
all=div.getElementsByTagName('i');
while (
div.innerHTML='',
all[0]
);
return v > 4 ? v:undef;
},
sizes: function(){
var sizes={h:0,w:0};
if(config.fillElement=="window"){
sizes.h=$.Window.height();
sizes.w=$.Window.width();
}else{
var $fillElement=$self.parents(config.fillElement).first();
if($fillElement.height()==0||$fillElement.data('windowHeight')==true){
$fillElement.data('windowHeight',true);
sizes.h=$.Window.height();
}else{
sizes.h=$fillElement.height();
}
if($fillElement.width()==0||$fillElement.data('windowWidth')==true){
$fillElement.data('windowWidth',true);
sizes.w=$.Window.width();
}else{
sizes.w=$fillElement.width();
}}
return sizes;
}}
$.BrowserTests=Utils.browser_tests();
if(typeof settings=='string'){
if($.BrowserTests.html5Video||!$self.is('video')){
var to,
$storageEl=$self.is('object') ? $self.parent().first():$self;
if(!$.Body.hasClass('mc-old-browser'))
$.Body.addClass('mc-old-browser');
$.Window
.data('h', Utils.sizes().h)
.data('w', Utils.sizes().w);
$storageEl
.data('h', $self.height())
.data('w', $self.width())
.data('ar', $self.width() / $self.height());
$.Window
.bind($.Events.RESIZE,
function(){
$.Window
.data('h', Utils.sizes().h)
.data('w', Utils.sizes().w);
to=$self.data('resizer');
clearTimeout(to);
to=setTimeout(Adjust[settings]($self), 200);
$self.data('resizer', to);
});
Adjust[settings]($self);
}}else{
$.Slides=Utils.construct_slide_object();
if($.BrowserTests.cssBackgroundSize){
if(config.debug) debug(' - Using Modern - ');
Modern.setup();
}else{
if(config.debug) debug(' - Using Old - ');
Old.setup();
}}
});
function debug($obj){
if(window.console&&window.console.log){
window.console.log($obj);
}}
}
$.fn.maximage.defaults={
debug: false,
cssBackgroundSize: true,
cssTransitions: true,
verticalCenter: true,
horizontalCenter: true,
scaleInterval: 20,
backgroundSize: 'cover',
fillElement: 'window',
overrideMSIEStop: false,
onFirstImageLoaded: function(){},
onImagesLoaded: function(){}}
})(jQuery);
(function(window, document, undefined){
'use strict';
var skrollr=window.skrollr={
get: function(){
return _instance;
},
init: function(options){
return _instance||new Skrollr(options);
},
VERSION: '0.6.11'
};
var hasProp=Object.prototype.hasOwnProperty;
var Math=window.Math;
var getStyle=window.getComputedStyle;
var documentElement;
var body;
var EVENT_TOUCHSTART='touchstart';
var EVENT_TOUCHMOVE='touchmove';
var EVENT_TOUCHCANCEL='touchcancel';
var EVENT_TOUCHEND='touchend';
var SKROLLABLE_CLASS='skrollable';
var SKROLLABLE_BEFORE_CLASS=SKROLLABLE_CLASS + '-before';
var SKROLLABLE_BETWEEN_CLASS=SKROLLABLE_CLASS + '-between';
var SKROLLABLE_AFTER_CLASS=SKROLLABLE_CLASS + '-after';
var SKROLLR_CLASS='skrollr';
var NO_SKROLLR_CLASS='no-' + SKROLLR_CLASS;
var SKROLLR_DESKTOP_CLASS=SKROLLR_CLASS + '-desktop';
var SKROLLR_MOBILE_CLASS=SKROLLR_CLASS + '-mobile';
var DEFAULT_EASING='linear';
var DEFAULT_DURATION=1000;
var DEFAULT_MOBILE_DECELERATION=0.004;
var DEFAULT_SMOOTH_SCROLLING_DURATION=200;
var ANCHOR_START='start';
var ANCHOR_END='end';
var ANCHOR_CENTER='center';
var ANCHOR_BOTTOM='bottom';
var SKROLLABLE_ID_DOM_PROPERTY='___skrollable_id';
var rxTrim=/^\s+|\s+$/g;
var rxKeyframeAttribute=/^data(?:-(_\w+))?(?:-?(-?\d+))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/;
var rxPropValue=/\s*([\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi;
var rxPropEasing=/^([a-z\-]+)\[(\w+)\]$/;
var rxCamelCase=/-([a-z])/g;
var rxCamelCaseFn=function(str, letter){
return letter.toUpperCase();
};
var rxNumericValue=/[\-+]?[\d]*\.?[\d]+/g;
var rxInterpolateString=/\{\?\}/g;
var rxRGBAIntegerColor=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g;
var rxGradient=/[a-z\-]+-gradient/g;
var theCSSPrefix='';
var theDashedCSSPrefix='';
var detectCSSPrefix=function(){
var rxPrefixes=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;
if(!getStyle){
return;
}
var style=getStyle(body, null);
for(var k in style){
theCSSPrefix=(k.match(rxPrefixes)||(+k==k&&style[k].match(rxPrefixes)));
if(theCSSPrefix){
break;
}}
if(!theCSSPrefix){
theCSSPrefix=theDashedCSSPrefix='';
return;
}
theCSSPrefix=theCSSPrefix[0];
if(theCSSPrefix.slice(0,1)==='-'){
theDashedCSSPrefix=theCSSPrefix;
theCSSPrefix=({
'-webkit-': 'webkit',
'-moz-': 'Moz',
'-ms-': 'ms',
'-o-': 'O'
})[theCSSPrefix];
}else{
theDashedCSSPrefix='-' + theCSSPrefix.toLowerCase() + '-';
}};
var polyfillRAF=function(){
var requestAnimFrame=window.requestAnimationFrame||window[theCSSPrefix.toLowerCase() + 'RequestAnimationFrame'];
var lastTime=_now();
if(_isMobile||!requestAnimFrame){
requestAnimFrame=function(callback){
var deltaTime=_now() - lastTime;
var delay=Math.max(0, 1000 / 60 - deltaTime);
window.setTimeout(function(){
lastTime=_now();
callback();
}, delay);
};}
return requestAnimFrame;
};
var easings={
begin: function(){
return 0;
},
end: function(){
return 1;
},
linear: function(p){
return p;
},
quadratic: function(p){
return p * p;
},
cubic: function(p){
return p * p * p;
},
swing: function(p){
return (-Math.cos(p * Math.PI) / 2) + 0.5;
},
sqrt: function(p){
return Math.sqrt(p);
},
outCubic: function(p){
return (Math.pow((p - 1), 3) + 1);
},
bounce: function(p){
var a;
if(p <=0.5083){
a=3;
}else if(p <=0.8489){
a=9;
}else if(p <=0.96208){
a=27;
}else if(p <=0.99981){
a=91;
}else{
return 1;
}
return 1 - Math.abs(3 * Math.cos(p * a * 1.028) / a);
}};
function Skrollr(options){
documentElement=document.documentElement;
body=document.body;
detectCSSPrefix();
_instance=this;
options=options||{};
_constants=options.constants||{};
if(options.easing){
for(var e in options.easing){
easings[e]=options.easing[e];
}}
_edgeStrategy=options.edgeStrategy||'set';
_listeners={
beforerender: options.beforerender,
render: options.render
};
_forceHeight=options.forceHeight!==false;
if(_forceHeight){
_scale=options.scale||1;
}
_mobileDeceleration=options.mobileDeceleration||DEFAULT_MOBILE_DECELERATION;
_smoothScrollingEnabled=options.smoothScrolling!==false;
_smoothScrollingDuration=options.smoothScrollingDuration||DEFAULT_SMOOTH_SCROLLING_DURATION;
_smoothScrolling={
targetTop: _instance.getScrollTop()
};
_isMobile=((options.mobileCheck||function(){
return (/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent||navigator.vendor||window.opera);
})());
if(_isMobile){
_skrollrBody=document.getElementById('skrollr-body');
if(_skrollrBody){
_detect3DTransforms();
}
_initMobile();
_updateClass(documentElement, [SKROLLR_CLASS, SKROLLR_MOBILE_CLASS], [NO_SKROLLR_CLASS]);
}else{
_updateClass(documentElement, [SKROLLR_CLASS, SKROLLR_DESKTOP_CLASS], [NO_SKROLLR_CLASS]);
}
_instance.refresh();
_addEvent(window, 'resize orientationchange', function(){
var width=documentElement.clientWidth;
var height=documentElement.clientHeight;
if(height!==_lastViewportHeight||width!==_lastViewportWidth){
_lastViewportHeight=height;
_lastViewportWidth=width;
_requestReflow=true;
}});
var requestAnimFrame=polyfillRAF();
(function animloop(){
_render();
requestAnimFrame(animloop);
}());
return _instance;
}
Skrollr.prototype.refresh=function(elements){
var elementIndex;
var elementsLength;
var ignoreID=false;
if(elements===undefined){
ignoreID=true;
_skrollables=[];
_skrollableIdCounter=0;
elements=document.getElementsByTagName('*');
}else{
elements=[].concat(elements);
}
elementIndex=0;
elementsLength=elements.length;
for(; elementIndex < elementsLength; elementIndex++){
var el=elements[elementIndex];
var anchorTarget=el;
var keyFrames=[];
var smoothScrollThis=_smoothScrollingEnabled;
var edgeStrategy=_edgeStrategy;
if(!el.attributes){
continue;
}
var attributeIndex=0;
var attributesLength=el.attributes.length;
for (; attributeIndex < attributesLength; attributeIndex++){
var attr=el.attributes[attributeIndex];
if(attr.name==='data-anchor-target'){
anchorTarget=document.querySelector(attr.value);
if(anchorTarget===null){
throw 'Unable to find anchor target "' + attr.value + '"';
}
continue;
}
if(attr.name==='data-smooth-scrolling'){
smoothScrollThis=attr.value!=='off';
continue;
}
if(attr.name==='data-edge-strategy'){
edgeStrategy=attr.value;
continue;
}
var match=attr.name.match(rxKeyframeAttribute);
if(match===null){
continue;
}
var constant=match[1];
constant=constant&&_constants[constant.substr(1)]||0;
var offset=(match[2] | 0) + constant;
var anchor1=match[3];
var anchor2=match[4]||anchor1;
var kf={
offset: offset,
props: attr.value,
element: el
};
keyFrames.push(kf);
if(!anchor1||anchor1===ANCHOR_START||anchor1===ANCHOR_END){
kf.mode='absolute';
if(anchor1===ANCHOR_END){
kf.isEnd=true;
}else{
kf.frame=offset * _scale;
delete kf.offset;
}}else{
kf.mode='relative';
kf.anchors=[anchor1, anchor2];
}}
if(!keyFrames.length){
continue;
}
var styleAttr, classAttr;
var id;
if(!ignoreID&&SKROLLABLE_ID_DOM_PROPERTY in el){
id=el[SKROLLABLE_ID_DOM_PROPERTY];
styleAttr=_skrollables[id].styleAttr;
classAttr=_skrollables[id].classAttr;
}else{
id=(el[SKROLLABLE_ID_DOM_PROPERTY]=_skrollableIdCounter++);
styleAttr=el.style.cssText;
classAttr=_getClass(el);
}
_skrollables[id]={
element: el,
styleAttr: styleAttr,
classAttr: classAttr,
anchorTarget: anchorTarget,
keyFrames: keyFrames,
smoothScrolling: smoothScrollThis,
edgeStrategy: edgeStrategy
};
_updateClass(el, [SKROLLABLE_CLASS], []);
}
_reflow();
elementIndex=0;
elementsLength=elements.length;
for(; elementIndex < elementsLength; elementIndex++){
var sk=_skrollables[elements[elementIndex][SKROLLABLE_ID_DOM_PROPERTY]];
if(sk===undefined){
continue;
}
_parseProps(sk);
_fillProps(sk);
}
return _instance;
};
Skrollr.prototype.relativeToAbsolute=function(element, viewportAnchor, elementAnchor){
var viewportHeight=documentElement.clientHeight;
var box=element.getBoundingClientRect();
var absolute=box.top;
var boxHeight=box.bottom - box.top;
if(viewportAnchor===ANCHOR_BOTTOM){
absolute -=viewportHeight;
}else if(viewportAnchor===ANCHOR_CENTER){
absolute -=viewportHeight / 2;
}
if(elementAnchor===ANCHOR_BOTTOM){
absolute +=boxHeight;
}else if(elementAnchor===ANCHOR_CENTER){
absolute +=boxHeight / 2;
}
absolute +=_instance.getScrollTop();
return (absolute + 0.5) | 0;
};
Skrollr.prototype.animateTo=function(top, options){
options=options||{};
var now=_now();
var scrollTop=_instance.getScrollTop();
_scrollAnimation={
startTop: scrollTop,
topDiff: top - scrollTop,
targetTop: top,
duration: options.duration||DEFAULT_DURATION,
startTime: now,
endTime: now + (options.duration||DEFAULT_DURATION),
easing: easings[options.easing||DEFAULT_EASING],
done: options.done
};
if(!_scrollAnimation.topDiff){
if(_scrollAnimation.done){
_scrollAnimation.done.call(_instance, false);
}
_scrollAnimation=undefined;
}
return _instance;
};
Skrollr.prototype.stopAnimateTo=function(){
if(_scrollAnimation&&_scrollAnimation.done){
_scrollAnimation.done.call(_instance, true);
}
_scrollAnimation=undefined;
};
Skrollr.prototype.isAnimatingTo=function(){
return !!_scrollAnimation;
};
Skrollr.prototype.setScrollTop=function(top, force){
if(force===true){
_lastTop=top;
_forceRender=true;
}
if(_isMobile){
_mobileOffset=Math.min(Math.max(top, 0), _maxKeyFrame);
}else{
window.scrollTo(0, top);
}
return _instance;
};
Skrollr.prototype.getScrollTop=function(){
if(_isMobile){
return _mobileOffset;
}else{
return window.pageYOffset||documentElement.scrollTop||body.scrollTop||0;
}};
Skrollr.prototype.on=function(name, fn){
_listeners[name]=fn;
return _instance;
};
Skrollr.prototype.off=function(name){
delete _listeners[name];
return _instance;
};
var _initMobile=function(){
var initialElement;
var initialTouchY;
var initialTouchX;
var currentTouchY;
var currentTouchX;
var lastTouchY;
var deltaY;
var initialTouchTime;
var currentTouchTime;
var lastTouchTime;
var deltaTime;
_addEvent(documentElement, [EVENT_TOUCHSTART, EVENT_TOUCHMOVE, EVENT_TOUCHCANCEL, EVENT_TOUCHEND].join(' '), function(e){
e.preventDefault();
var touch=e.changedTouches[0];
currentTouchY=touch.clientY;
currentTouchX=touch.clientX;
currentTouchTime=e.timeStamp;
switch(e.type){
case EVENT_TOUCHSTART:
if(initialElement){
initialElement.blur();
}
_instance.stopAnimateTo();
initialElement=e.target;
initialTouchY=lastTouchY=currentTouchY;
initialTouchX=currentTouchX;
initialTouchTime=currentTouchTime;
break;
case EVENT_TOUCHMOVE:
deltaY=currentTouchY - lastTouchY;
deltaTime=currentTouchTime - lastTouchTime;
_instance.setScrollTop(_mobileOffset - deltaY, true);
lastTouchY=currentTouchY;
lastTouchTime=currentTouchTime;
break;
default:
case EVENT_TOUCHCANCEL:
case EVENT_TOUCHEND:
var distanceY=initialTouchY - currentTouchY;
var distanceX=initialTouchX - currentTouchX;
var distance2=distanceX * distanceX + distanceY * distanceY;
if(distance2 < 49){
initialElement.focus();
initialElement.click();
return;
}
initialElement=undefined;
var speed=deltaY / deltaTime;
speed=Math.max(Math.min(speed, 3), -3);
var duration=Math.abs(speed / _mobileDeceleration);
var targetOffset=speed * duration + 0.5 * _mobileDeceleration * duration * duration;
var targetTop=_instance.getScrollTop() - targetOffset;
var targetRatio=0;
if(targetTop > _maxKeyFrame){
targetRatio=(_maxKeyFrame - targetTop) / targetOffset;
targetTop=_maxKeyFrame;
}else if(targetTop < 0){
targetRatio=-targetTop / targetOffset;
targetTop=0;
}
duration=duration * (1 - targetRatio);
_instance.animateTo(targetTop, {easing: 'outCubic', duration: duration});
break;
}});
window.scrollTo(0, 0);
documentElement.style.overflow=body.style.overflow='hidden';
};
var _updateDependentKeyFrames=function(){
var skrollable;
var element;
var anchorTarget;
var keyFrames;
var keyFrameIndex;
var keyFramesLength;
var kf;
var skrollableIndex;
var skrollablesLength;
skrollableIndex=0;
skrollablesLength=_skrollables.length;
for(; skrollableIndex < skrollablesLength; skrollableIndex++){
skrollable=_skrollables[skrollableIndex];
element=skrollable.element;
anchorTarget=skrollable.anchorTarget;
keyFrames=skrollable.keyFrames;
keyFrameIndex=0;
keyFramesLength=keyFrames.length;
for(; keyFrameIndex < keyFramesLength; keyFrameIndex++){
kf=keyFrames[keyFrameIndex];
if(kf.mode==='relative'){
_reset(element);
kf.frame=_instance.relativeToAbsolute(anchorTarget, kf.anchors[0], kf.anchors[1]) - kf.offset;
_reset(element, true);
}
if(_forceHeight){
if(!kf.isEnd&&kf.frame > _maxKeyFrame){
_maxKeyFrame=kf.frame;
}}
}}
_maxKeyFrame=Math.max(_maxKeyFrame, _getDocumentHeight());
skrollableIndex=0;
skrollablesLength=_skrollables.length;
for(; skrollableIndex < skrollablesLength; skrollableIndex++){
skrollable=_skrollables[skrollableIndex];
keyFrames=skrollable.keyFrames;
keyFrameIndex=0;
keyFramesLength=keyFrames.length;
for(; keyFrameIndex < keyFramesLength; keyFrameIndex++){
kf=keyFrames[keyFrameIndex];
if(kf.isEnd){
kf.frame=_maxKeyFrame - kf.offset;
}}
skrollable.keyFrames.sort(_keyFrameComparator);
}};
var _calcSteps=function(fakeFrame, actualFrame){
var skrollableIndex=0;
var skrollablesLength=_skrollables.length;
for(; skrollableIndex < skrollablesLength; skrollableIndex++){
var skrollable=_skrollables[skrollableIndex];
var element=skrollable.element;
var frame=skrollable.smoothScrolling ? fakeFrame:actualFrame;
var frames=skrollable.keyFrames;
var firstFrame=frames[0].frame;
var lastFrame=frames[frames.length - 1].frame;
var beforeFirst=frame < firstFrame;
var afterLast=frame > lastFrame;
var firstOrLastFrame=frames[beforeFirst ? 0:frames.length - 1];
var key;
var value;
if(beforeFirst||afterLast){
if(beforeFirst&&skrollable.edge===-1||afterLast&&skrollable.edge===1){
continue;
}
_updateClass(element, [beforeFirst ? SKROLLABLE_BEFORE_CLASS:SKROLLABLE_AFTER_CLASS], [SKROLLABLE_BEFORE_CLASS, SKROLLABLE_BETWEEN_CLASS, SKROLLABLE_AFTER_CLASS]);
skrollable.edge=beforeFirst ? -1:1;
switch(skrollable.edgeStrategy){
case 'reset':
_reset(element);
continue;
case 'ease':
frame=firstOrLastFrame.frame;
break;
default:
case 'set':
var props=firstOrLastFrame.props;
for(key in props){
if(hasProp.call(props, key)){
value=_interpolateString(props[key].value);
skrollr.setStyle(element, key, value);
}}
continue;
}}else{
if(skrollable.edge!==0){
_updateClass(element, [SKROLLABLE_CLASS, SKROLLABLE_BETWEEN_CLASS], [SKROLLABLE_BEFORE_CLASS, SKROLLABLE_AFTER_CLASS]);
skrollable.edge=0;
}}
var keyFrameIndex=0;
var framesLength=frames.length - 1;
for(; keyFrameIndex < framesLength; keyFrameIndex++){
if(frame >=frames[keyFrameIndex].frame&&frame <=frames[keyFrameIndex + 1].frame){
var left=frames[keyFrameIndex];
var right=frames[keyFrameIndex + 1];
for(key in left.props){
if(hasProp.call(left.props, key)){
var progress=(frame - left.frame) / (right.frame - left.frame);
progress=left.props[key].easing(progress);
value=_calcInterpolation(left.props[key].value, right.props[key].value, progress);
value=_interpolateString(value);
skrollr.setStyle(element, key, value);
}}
break;
}}
}};
var _render=function(){
if(_requestReflow){
_requestReflow=false;
_reflow();
}
var renderTop=_instance.getScrollTop();
var afterAnimationCallback;
var now=_now();
var progress;
if(_scrollAnimation){
if(now >=_scrollAnimation.endTime){
renderTop=_scrollAnimation.targetTop;
afterAnimationCallback=_scrollAnimation.done;
_scrollAnimation=undefined;
}else{
progress=_scrollAnimation.easing((now - _scrollAnimation.startTime) / _scrollAnimation.duration);
renderTop=(_scrollAnimation.startTop + progress * _scrollAnimation.topDiff) | 0;
}
_instance.setScrollTop(renderTop, true);
}
else if(!_isMobile){
var smoothScrollingDiff=_smoothScrolling.targetTop - renderTop;
if(smoothScrollingDiff){
_smoothScrolling={
startTop: _lastTop,
topDiff: renderTop - _lastTop,
targetTop: renderTop,
startTime: _lastRenderCall,
endTime: _lastRenderCall + _smoothScrollingDuration
};}
if(now <=_smoothScrolling.endTime){
progress=easings.sqrt((now - _smoothScrolling.startTime) / _smoothScrollingDuration);
renderTop=(_smoothScrolling.startTop + progress * _smoothScrolling.topDiff) | 0;
}}
if(_isMobile&&_skrollrBody){
skrollr.setStyle(_skrollrBody, 'transform', 'translate(0, ' + -(_mobileOffset) + 'px) ' + _translateZ);
}
if(_forceRender||_lastTop!==renderTop){
_direction=(renderTop >=_lastTop) ? 'down':'up';
_forceRender=false;
var listenerParams={
curTop: renderTop,
lastTop: _lastTop,
maxTop: _maxKeyFrame,
direction: _direction
};
var continueRendering=_listeners.beforerender&&_listeners.beforerender.call(_instance, listenerParams);
if(continueRendering!==false){
_calcSteps(renderTop, _instance.getScrollTop());
_lastTop=renderTop;
if(_listeners.render){
_listeners.render.call(_instance, listenerParams);
}}
if(afterAnimationCallback){
afterAnimationCallback.call(_instance, false);
}}
_lastRenderCall=now;
};
var _parseProps=function(skrollable){
var keyFrameIndex=0;
var keyFramesLength=skrollable.keyFrames.length;
for(; keyFrameIndex < keyFramesLength; keyFrameIndex++){
var frame=skrollable.keyFrames[keyFrameIndex];
var easing;
var value;
var prop;
var props={};
var match;
while((match=rxPropValue.exec(frame.props))!==null){
prop=match[1];
value=match[2];
easing=prop.match(rxPropEasing);
if(easing!==null){
prop=easing[1];
easing=easing[2];
}else{
easing=DEFAULT_EASING;
}
value=value.indexOf('!') ? _parseProp(value):[value.slice(1)];
props[prop]={
value: value,
easing: easings[easing]
};}
frame.props=props;
}};
var _parseProp=function(val){
var numbers=[];
rxRGBAIntegerColor.lastIndex=0;
val=val.replace(rxRGBAIntegerColor, function(rgba){
return rgba.replace(rxNumericValue, function(n){
return n / 255 * 100 + '%';
});
});
if(theDashedCSSPrefix){
rxGradient.lastIndex=0;
val=val.replace(rxGradient, function(s){
return theDashedCSSPrefix + s;
});
}
val=val.replace(rxNumericValue, function(n){
numbers.push(+n);
return '{?}';
});
numbers.unshift(val);
return numbers;
};
var _fillProps=function(sk){
var propList={};
var keyFrameIndex;
var keyFramesLength;
keyFrameIndex=0;
keyFramesLength=sk.keyFrames.length;
for(; keyFrameIndex < keyFramesLength; keyFrameIndex++){
_fillPropForFrame(sk.keyFrames[keyFrameIndex], propList);
}
propList={};
keyFrameIndex=sk.keyFrames.length - 1;
for(; keyFrameIndex >=0; keyFrameIndex--){
_fillPropForFrame(sk.keyFrames[keyFrameIndex], propList);
}};
var _fillPropForFrame=function(frame, propList){
var key;
for(key in propList){
if(!hasProp.call(frame.props, key)){
frame.props[key]=propList[key];
}}
for(key in frame.props){
propList[key]=frame.props[key];
}};
var _calcInterpolation=function(val1, val2, progress){
var valueIndex;
var val1Length=val1.length;
if(val1Length!==val2.length){
throw 'Can\'t interpolate between "' + val1[0] + '" and "' + val2[0] + '"';
}
var interpolated=[val1[0]];
valueIndex=1;
for(; valueIndex < val1Length; valueIndex++){
interpolated[valueIndex]=val1[valueIndex] + ((val2[valueIndex] - val1[valueIndex]) * progress);
}
return interpolated;
};
var _interpolateString=function(val){
var valueIndex=1;
rxInterpolateString.lastIndex=0;
return val[0].replace(rxInterpolateString, function(){
return val[valueIndex++];
});
};
var _reset=function(elements, undo){
elements=[].concat(elements);
var skrollable;
var element;
var elementsIndex=0;
var elementsLength=elements.length;
for(; elementsIndex < elementsLength; elementsIndex++){
element=elements[elementsIndex];
skrollable=_skrollables[element[SKROLLABLE_ID_DOM_PROPERTY]];
if(!skrollable){
continue;
}
if(undo){
element.style.cssText=skrollable.dirtyStyleAttr;
_updateClass(element, skrollable.dirtyClassAttr);
}else{
skrollable.dirtyStyleAttr=element.style.cssText;
skrollable.dirtyClassAttr=_getClass(element);
element.style.cssText=skrollable.styleAttr;
_updateClass(element, skrollable.classAttr);
}}
};
var _detect3DTransforms=function(){
_translateZ='translateZ(0)';
skrollr.setStyle(_skrollrBody, 'transform', _translateZ);
var computedStyle=getStyle(_skrollrBody);
var computedTransform=computedStyle.getPropertyValue('transform');
var computedTransformWithPrefix=computedStyle.getPropertyValue(theDashedCSSPrefix + 'transform');
var has3D=(computedTransform&&computedTransform!=='none')||(computedTransformWithPrefix&&computedTransformWithPrefix!=='none');
if(!has3D){
_translateZ='';
}};
skrollr.setStyle=function(el, prop, val){
var style=el.style;
prop=prop.replace(rxCamelCase, rxCamelCaseFn).replace('-', '');
if(prop==='zIndex'){
style[prop]='' + (val | 0);
}
else if(prop==='float'){
style.styleFloat=style.cssFloat=val;
}else{
try {
if(theCSSPrefix){
style[theCSSPrefix + prop.slice(0,1).toUpperCase() + prop.slice(1)]=val;
}
style[prop]=val;
} catch(ignore){}}
};
var _addEvent=skrollr.addEvent=function(element, names, callback){
var intermediate=function(e){
e=e||window.event;
if(!e.target){
e.target=e.srcElement;
}
if(!e.preventDefault){
e.preventDefault=function(){
e.returnValue=false;
};}
return callback.call(this, e);
};
names=names.split(' ');
var nameCounter=0;
var namesLength=names.length;
for(; nameCounter < namesLength; nameCounter++){
if(element.addEventListener){
element.addEventListener(names[nameCounter], callback, false);
}else{
element.attachEvent('on' + names[nameCounter], intermediate);
}}
};
var _reflow=function(){
var pos=_instance.getScrollTop();
_maxKeyFrame=0;
if(_forceHeight&&!_isMobile){
body.style.height='auto';
}
_updateDependentKeyFrames();
if(_forceHeight&&!_isMobile){
body.style.height=(_maxKeyFrame + documentElement.clientHeight) + 'px';
}
if(_isMobile){
_instance.setScrollTop(Math.min(_instance.getScrollTop(), _maxKeyFrame));
}else{
_instance.setScrollTop(pos, true);
}
_forceRender=true;
};
var _getDocumentHeight=function(){
var skrollrBodyHeight=(_skrollrBody&&_skrollrBody.offsetHeight||0);
var bodyHeight=Math.max(skrollrBodyHeight, body.scrollHeight, body.offsetHeight, documentElement.scrollHeight, documentElement.offsetHeight, documentElement.clientHeight);
return bodyHeight - documentElement.clientHeight;
};
var _getClass=function(element){
var prop='className';
if(window.SVGElement&&element instanceof window.SVGElement){
element=element[prop];
prop='baseVal';
}
return element[prop];
};
var _updateClass=function(element, add, remove){
var prop='className';
if(window.SVGElement&&element instanceof window.SVGElement){
element=element[prop];
prop='baseVal';
}
if(remove===undefined){
element[prop]=add;
return;
}
var val=element[prop];
var classRemoveIndex=0;
var removeLength=remove.length;
for(; classRemoveIndex < removeLength; classRemoveIndex++){
val=_untrim(val).replace(_untrim(remove[classRemoveIndex]), ' ');
}
val=_trim(val);
var classAddIndex=0;
var addLength=add.length;
for(; classAddIndex < addLength; classAddIndex++){
if(_untrim(val).indexOf(_untrim(add[classAddIndex]))===-1){
val +=' ' + add[classAddIndex];
}}
element[prop]=_trim(val);
};
var _trim=function(a){
return a.replace(rxTrim, '');
};
var _untrim=function(a){
return ' ' + a + ' ';
};
var _now=Date.now||function(){
return +new Date();
};
var _keyFrameComparator=function(a, b){
return a.frame - b.frame;
};
var _instance;
var _skrollables;
var _skrollrBody;
var _listeners;
var _forceHeight;
var _maxKeyFrame=0;
var _scale=1;
var _constants;
var _mobileDeceleration;
var _direction='down';
var _lastTop=-1;
var _lastRenderCall=_now();
var _lastViewportWidth=0;
var _lastViewportHeight=0;
var _requestReflow=false;
var _scrollAnimation;
var _smoothScrollingEnabled;
var _smoothScrollingDuration;
var _smoothScrolling;
var _forceRender;
var _skrollableIdCounter=0;
var _edgeStrategy;
var _isMobile=false;
var _mobileOffset=0;
var _translateZ;
}(window, document));
window.addComment=function(u){var v,y,p,f=u.document,I={commentReplyClass:"comment-reply-link",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=u.MutationObserver||u.WebKitMutationObserver||u.MozMutationObserver,i="querySelector"in f&&"addEventListener"in u,n=!!f.documentElement.dataset;function t(){r(),e&&new e(d).observe(f.body,{childList:!0,subtree:!0})}function r(e){if(i&&(v=h(I.cancelReplyId),y=h(I.commentFormId),v)){v.addEventListener("touchstart",a),v.addEventListener("click",a);var t=function(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return y.removeEventListener("keydown",t),e.preventDefault(),y.submit.click(),!1};y&&y.addEventListener("keydown",t);for(var n,r=function(e){var t=I.commentReplyClass;e&&e.childNodes||(e=f);t=f.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return t}(e),d=0,o=r.length;d